diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-28 17:57:48 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.ravnborg.org> | 2006-09-30 05:19:20 -0400 |
commit | f3cbcdc955d0d2c8b4c52d6b73fc536b01b68c64 (patch) | |
tree | 3619243852b54799123f0fead031b8b45abf7aca /scripts/kconfig/lxdialog/inputbox.c | |
parent | 2982de6993e6d9944f2215d7cb9b558b465a0c99 (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/inputbox.c')
-rw-r--r-- | scripts/kconfig/lxdialog/inputbox.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c index 9c53098d6b74..edb7975dbaa2 100644 --- a/scripts/kconfig/lxdialog/inputbox.c +++ b/scripts/kconfig/lxdialog/inputbox.c | |||
@@ -106,7 +106,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
106 | 106 | ||
107 | wrefresh(dialog); | 107 | wrefresh(dialog); |
108 | 108 | ||
109 | while (key != ESC) { | 109 | while (key != KEY_ESC) { |
110 | key = wgetch(dialog); | 110 | key = wgetch(dialog); |
111 | 111 | ||
112 | if (button == -1) { /* Input box selected */ | 112 | if (button == -1) { /* Input box selected */ |
@@ -215,12 +215,14 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
215 | return (button == -1 ? 0 : button); | 215 | return (button == -1 ? 0 : button); |
216 | case 'X': | 216 | case 'X': |
217 | case 'x': | 217 | case 'x': |
218 | key = ESC; | 218 | key = KEY_ESC; |
219 | case ESC: | 219 | break; |
220 | case KEY_ESC: | ||
221 | key = on_key_esc(dialog); | ||
220 | break; | 222 | break; |
221 | } | 223 | } |
222 | } | 224 | } |
223 | 225 | ||
224 | delwin(dialog); | 226 | delwin(dialog); |
225 | return 255; /* ESC pressed */ | 227 | return KEY_ESC; /* ESC pressed */ |
226 | } | 228 | } |