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