aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/lxdialog/menubox.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-28 17:57:48 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 05:19:20 -0400
commitf3cbcdc955d0d2c8b4c52d6b73fc536b01b68c64 (patch)
tree3619243852b54799123f0fead031b8b45abf7aca /scripts/kconfig/lxdialog/menubox.c
parent2982de6993e6d9944f2215d7cb9b558b465a0c99 (diff)
kconfig/lxdialog: let <ESC><ESC> behave as expected
<ESC><ESC> is used to step one back in the dialogs. When lxdialog became built-in pressing <ESC> once would cause one step back and pressing <ESC><ESC> would cause two steps back. This patch - based on concept from Roman Zippel <zippel@linux-m68k.org> - makes one <ESC> a noop and pressing <ESC><ESC> will cause one step backward. In addition the final yes/no dialog now has the option to go back to the the kernel configuration. So if you get too far out you can now go back to configuring the kernel without saving and starting all over again. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/menubox.c')
-rw-r--r--scripts/kconfig/lxdialog/menubox.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index f39ae29f4fcc..d3305bad15c7 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -263,7 +263,7 @@ int dialog_menu(const char *title, const char *prompt, int height, int width,
263 wmove(menu, choice, item_x + 1); 263 wmove(menu, choice, item_x + 1);
264 wrefresh(menu); 264 wrefresh(menu);
265 265
266 while (key != ESC) { 266 while (key != KEY_ESC) {
267 key = wgetch(menu); 267 key = wgetch(menu);
268 268
269 if (key < 256 && isalpha(key)) 269 if (key < 256 && isalpha(key))
@@ -402,12 +402,14 @@ int dialog_menu(const char *title, const char *prompt, int height, int width,
402 return button; 402 return button;
403 case 'e': 403 case 'e':
404 case 'x': 404 case 'x':
405 key = ESC; 405 key = KEY_ESC;
406 case ESC: 406 break;
407 case KEY_ESC:
408 key = on_key_esc(menu);
407 break; 409 break;
408 } 410 }
409 } 411 }
410 delwin(menu); 412 delwin(menu);
411 delwin(dialog); 413 delwin(dialog);
412 return 255; /* ESC pressed */ 414 return key; /* ESC pressed */
413} 415}