aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/lxdialog/yesno.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/yesno.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/yesno.c')
-rw-r--r--scripts/kconfig/lxdialog/yesno.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/kconfig/lxdialog/yesno.c b/scripts/kconfig/lxdialog/yesno.c
index 9fc24492c52f..8364f9dd01c3 100644
--- a/scripts/kconfig/lxdialog/yesno.c
+++ b/scripts/kconfig/lxdialog/yesno.c
@@ -69,7 +69,7 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width)
69 69
70 print_buttons(dialog, height, width, 0); 70 print_buttons(dialog, height, width, 0);
71 71
72 while (key != ESC) { 72 while (key != KEY_ESC) {
73 key = wgetch(dialog); 73 key = wgetch(dialog);
74 switch (key) { 74 switch (key) {
75 case 'Y': 75 case 'Y':
@@ -93,11 +93,12 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width)
93 case '\n': 93 case '\n':
94 delwin(dialog); 94 delwin(dialog);
95 return button; 95 return button;
96 case ESC: 96 case KEY_ESC:
97 key = on_key_esc(dialog);
97 break; 98 break;
98 } 99 }
99 } 100 }
100 101
101 delwin(dialog); 102 delwin(dialog);
102 return 255; /* ESC pressed */ 103 return key; /* ESC pressed */
103} 104}