xref: /OK3568_Linux_fs/buildroot/support/kconfig/patches/16-fix-space-to-de-select-options.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyuncommit 6faa447282fe90d42e0513af46c13f20b4b327d4
2*4882a593SmuzhiyunAuthor: Yann E. MORIN <yann.morin.1998@free.fr>
3*4882a593SmuzhiyunDate:   Wed Nov 13 22:45:02 2013 +0100
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun    support/kconfig: fix 'space' to (de)select options
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun    In case a menu has comment without letters/numbers (eg. characters
8*4882a593Smuzhiyun    matching the regexp '^[^[:alpha:][:digit:]]+$', for example - or *),
9*4882a593Smuzhiyun    hitting space will cycle through those comments, rather than
10*4882a593Smuzhiyun    selecting/deselecting the currently-highlighted option.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    This is the behaviour of hitting any letter/digit: jump to the next
13*4882a593Smuzhiyun    option which prompt starts with that letter. The only letters that
14*4882a593Smuzhiyun    do not behave as such are 'y' 'm' and 'n'. Prompts that start with
15*4882a593Smuzhiyun    one of those three letters are instead matched on the first letter
16*4882a593Smuzhiyun    that is not 'y', 'm' or 'n'.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Fix that by treating 'space' as we treat y/m/n, ie. as an action key,
19*4882a593Smuzhiyun    not as shortcut to jump to  prompt.
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun    Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
22*4882a593Smuzhiyun    Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
23*4882a593Smuzhiyun    Cc: Peter Korsgaard <jacmet@uclibc.org>
24*4882a593Smuzhiyun    Cc: Samuel Martin <s.martin49@gmail.com>
25*4882a593Smuzhiyun    Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
26*4882a593Smuzhiyun    ---
27*4882a593Smuzhiyun    Note: I'll be running this upstream soonish.
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunIndex: kconfig/lxdialog/menubox.c
30*4882a593Smuzhiyun===================================================================
31*4882a593Smuzhiyun--- kconfig.orig/lxdialog/menubox.c
32*4882a593Smuzhiyun+++ kconfig/lxdialog/menubox.c
33*4882a593Smuzhiyun@@ -285,7 +285,7 @@ do_resize:
34*4882a593Smuzhiyun 		if (key < 256 && isalpha(key))
35*4882a593Smuzhiyun 			key = tolower(key);
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun-		if (strchr("ynmh", key))
38*4882a593Smuzhiyun+		if (strchr("ynmh ", key))
39*4882a593Smuzhiyun 			i = max_choice;
40*4882a593Smuzhiyun 		else {
41*4882a593Smuzhiyun 			for (i = choice + 1; i < max_choice; i++) {
42