diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-15 02:50:48 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-15 02:50:48 +0000 |
commit | aaad85f64d352118f3190bab31f3701ca1673bfd (patch) | |
tree | 88ce92f520362cdd01a9c9902dff58eb09126ee5 | |
parent | ed2799b54882ad9198045d3062d3406b049c1c1e (diff) | |
download | FreeBSD-src-aaad85f64d352118f3190bab31f3701ca1673bfd.zip FreeBSD-src-aaad85f64d352118f3190bab31f3701ca1673bfd.tar.gz |
Allow emacs-style next/prev characters as well as arrow keys so that
I can offer this as a consistent feature.
-rw-r--r-- | gnu/lib/libdialog/checklist.c | 6 | ||||
-rw-r--r-- | gnu/lib/libdialog/menubox.c | 6 | ||||
-rw-r--r-- | gnu/lib/libdialog/msgbox.c | 2 | ||||
-rw-r--r-- | gnu/lib/libdialog/radiolist.c | 6 | ||||
-rw-r--r-- | gnu/lib/libdialog/textbox.c | 2 |
5 files changed, 13 insertions, 9 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index 98a2a81..19e2e5c 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -255,12 +255,12 @@ draw: break; if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) || key == KEY_UP || - key == KEY_DOWN || key == ' ' || key == '+' || key == '-' ) { + key == KEY_DOWN || key == ' ' || key == '+' || key == '-' || key == '' || key == '') { if (key >= '1' && key <= MIN('9', '0'+max_choice)) i = key - '1'; - else if (key == KEY_UP || key == '-') { + else if (key == KEY_UP || key == '-' || key == '') { if (!choice) { if (scroll) { /* Scroll list down */ @@ -283,7 +283,7 @@ draw: else i = choice - 1; } - else if (key == KEY_DOWN || key == '+') { + else if (key == KEY_DOWN || key == '+' || key == '') { if (choice == max_choice - 1) { if (scroll+choice < item_no-1) { /* Scroll list up */ diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index 3755d82..36b2136 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -236,10 +236,10 @@ draw: break; if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) || - key == KEY_UP || key == KEY_DOWN || key == '-' || key == '+') { + key == KEY_UP || key == KEY_DOWN || key == '-' || key == '+' || key == '' || key == '') { if (key >= '1' && key <= MIN('9', '0'+max_choice)) i = key - '1'; - else if (key == KEY_UP || key == '-') { + else if (key == KEY_UP || key == '-' || key == '') { if (!choice) { if (scroll) { /* Scroll menu down */ @@ -262,7 +262,7 @@ draw: else i = choice - 1; } - else if (key == KEY_DOWN || key == '+') + else if (key == KEY_DOWN || key == '+' || key == '') if (choice == max_choice - 1) { if (scroll+choice < item_no-1) { /* Scroll menu up */ diff --git a/gnu/lib/libdialog/msgbox.c b/gnu/lib/libdialog/msgbox.c index 0886dc1..4f88443 100644 --- a/gnu/lib/libdialog/msgbox.c +++ b/gnu/lib/libdialog/msgbox.c @@ -193,9 +193,11 @@ dialog_mesgbox(unsigned char *title, unsigned char *prompt, int height, int widt startline = max_lines - theight; if (startline < 0) startline = 0; break; + case '\020': /* ^P */ case KEY_UP: if (startline > 0) startline--; break; + case '\016': /* ^N */ case KEY_DOWN: if (startline < max_lines - theight) startline++; break; diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index 4253341..6e8c348 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -262,10 +262,10 @@ draw: break; if (i < max_choice || (key >= '1' && key <= MIN('9', '0' + max_choice)) || - key == KEY_UP || key == KEY_DOWN || key == ' ' || key == '+' || key == '-' ) { + key == KEY_UP || key == KEY_DOWN || key == ' ' || key == '+' || key == '-' || key == '' || key == '') { if (key >= '1' && key <= MIN('9', '0' + max_choice)) i = key - '1'; - else if (key == KEY_UP || key == '-') { + else if (key == KEY_UP || key == '-' || key == '') { if (!choice) { if (scroll) { /* Scroll list down */ @@ -288,7 +288,7 @@ draw: else i = choice - 1; } - else if (key == KEY_DOWN || key == '+') { + else if (key == KEY_DOWN || key == '+' || key == '') { if (choice == max_choice - 1) { if (scroll + choice < item_no - 1) { /* Scroll list up */ diff --git a/gnu/lib/libdialog/textbox.c b/gnu/lib/libdialog/textbox.c index 0e8aaea..91f43a2 100644 --- a/gnu/lib/libdialog/textbox.c +++ b/gnu/lib/libdialog/textbox.c @@ -219,6 +219,7 @@ int dialog_textbox(unsigned char *title, unsigned char *file, int height, int wi break; case 'K': /* Previous line */ case 'k': + case '\020': /* ^P */ case KEY_UP: if (!begin_reached) { back_lines(page_length+1); @@ -266,6 +267,7 @@ int dialog_textbox(unsigned char *title, unsigned char *file, int height, int wi break; case 'J': /* Next line */ case 'j': + case '\016': /* ^N */ case KEY_DOWN: if (!end_reached) { begin_reached = 0; |