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/textbox.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/textbox.c')
-rw-r--r-- | scripts/kconfig/lxdialog/textbox.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c index 86b0770b0387..a99e1f497d67 100644 --- a/scripts/kconfig/lxdialog/textbox.c +++ b/scripts/kconfig/lxdialog/textbox.c | |||
@@ -92,7 +92,7 @@ int dialog_textbox(const char *title, const char *tbuf, int height, int width) | |||
92 | wmove(dialog, cur_y, cur_x); /* Restore cursor position */ | 92 | wmove(dialog, cur_y, cur_x); /* Restore cursor position */ |
93 | wrefresh(dialog); | 93 | wrefresh(dialog); |
94 | 94 | ||
95 | while ((key != ESC) && (key != '\n')) { | 95 | while ((key != KEY_ESC) && (key != '\n')) { |
96 | key = wgetch(dialog); | 96 | key = wgetch(dialog); |
97 | switch (key) { | 97 | switch (key) { |
98 | case 'E': /* Exit */ | 98 | case 'E': /* Exit */ |
@@ -228,13 +228,14 @@ int dialog_textbox(const char *title, const char *tbuf, int height, int width) | |||
228 | wmove(dialog, cur_y, cur_x); | 228 | wmove(dialog, cur_y, cur_x); |
229 | wrefresh(dialog); | 229 | wrefresh(dialog); |
230 | break; | 230 | break; |
231 | case ESC: | 231 | case KEY_ESC: |
232 | key = on_key_esc(dialog); | ||
232 | break; | 233 | break; |
233 | } | 234 | } |
234 | } | 235 | } |
235 | delwin(text); | 236 | delwin(text); |
236 | delwin(dialog); | 237 | delwin(dialog); |
237 | return 255; /* ESC pressed */ | 238 | return key; /* ESC pressed */ |
238 | } | 239 | } |
239 | 240 | ||
240 | /* | 241 | /* |