diff options
author | Dirk Gouders <dirk@gouders.net> | 2013-05-19 15:48:44 -0400 |
---|---|---|
committer | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-05-29 18:13:32 -0400 |
commit | 063f4661fde8c03c4c03f8a205071a52691c152e (patch) | |
tree | 59bb40ca59243d85c9ce2710bfb8b968e43b097c | |
parent | 57a9c7609d7418ce75324df38f66cd7d937a77cb (diff) |
mconf: handle keys in empty dialogs
When entering an empty dialog, using the movement keys resulted in
unexpected characters beeing displayed, other keys like "z" and "h"
did not work as expected.
This patch handles the movement keys as well as other keys, especially
"z", "h" and "/".
Signed-off-by: Dirk Gouders <dirk@gouders.net>
[yann.morin.1998@free.fr: keep lines <80 chars, so reorder test]
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-rw-r--r-- | scripts/kconfig/lxdialog/menubox.c | 9 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 11 |
2 files changed, 11 insertions, 9 deletions
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c index 48d382e7e374..38cd69c5660e 100644 --- a/scripts/kconfig/lxdialog/menubox.c +++ b/scripts/kconfig/lxdialog/menubox.c | |||
@@ -303,10 +303,11 @@ do_resize: | |||
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | if (i < max_choice || | 306 | if (item_count() != 0 && |
307 | key == KEY_UP || key == KEY_DOWN || | 307 | (i < max_choice || |
308 | key == '-' || key == '+' || | 308 | key == KEY_UP || key == KEY_DOWN || |
309 | key == KEY_PPAGE || key == KEY_NPAGE) { | 309 | key == '-' || key == '+' || |
310 | key == KEY_PPAGE || key == KEY_NPAGE)) { | ||
310 | /* Remove highligt of current item */ | 311 | /* Remove highligt of current item */ |
311 | print_item(scroll + choice, choice, FALSE); | 312 | print_item(scroll + choice, choice, FALSE); |
312 | 313 | ||
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 387dc8daf7b2..a69cbd78fb38 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -670,11 +670,12 @@ static void conf(struct menu *menu, struct menu *active_menu) | |||
670 | active_menu, &s_scroll); | 670 | active_menu, &s_scroll); |
671 | if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) | 671 | if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) |
672 | break; | 672 | break; |
673 | if (!item_activate_selected()) | 673 | if (item_count() != 0) { |
674 | continue; | 674 | if (!item_activate_selected()) |
675 | if (!item_tag()) | 675 | continue; |
676 | continue; | 676 | if (!item_tag()) |
677 | 677 | continue; | |
678 | } | ||
678 | submenu = item_data(); | 679 | submenu = item_data(); |
679 | active_menu = item_data(); | 680 | active_menu = item_data(); |
680 | if (submenu) | 681 | if (submenu) |