From 76deb4cec4db519b752b35185a70d9f093af90e6 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 27 Oct 2002 23:59:53 +0000 Subject: [PATCH] 2002-10-28 Yoshinori K. Okuji * grub/asmstub.c (console_translate_key): Deal with KEY_PPAGE and KEY_NPAGE. * stage2/serial.c (serial_translate_key_sequence): Added two new codes for Page Up and Page Down. * stage2/asm.S (translation_table): Added entries for KEY_PPAGE and KEY_NPAGE. * stage2/stage2.c (run_menu): Deal with Page Up and Page Down. Also recognize the right key for the selection of a boot entry. Suggested by Adam Lackorzynski . --- ChangeLog | 12 ++++++++++++ NEWS | 1 + THANKS | 1 + grub/asmstub.c | 4 ++++ stage2/asm.S | 2 ++ stage2/serial.c | 4 +++- stage2/stage2.c | 28 +++++++++++++++++++++++++++- 7 files changed, 50 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 413bc5b41..86e3f0294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-10-28 Yoshinori K. Okuji + + * grub/asmstub.c (console_translate_key): Deal with KEY_PPAGE + and KEY_NPAGE. + * stage2/serial.c (serial_translate_key_sequence): Added two new + codes for Page Up and Page Down. + * stage2/asm.S (translation_table): Added entries for KEY_PPAGE + and KEY_NPAGE. + * stage2/stage2.c (run_menu): Deal with Page Up and Page Down. + Also recognize the right key for the selection of a boot entry. + Suggested by Adam Lackorzynski . + 2002-10-10 Jason Thomas * stage2/builtins.c (setup_func): Added missing space to --force-lba diff --git a/NEWS b/NEWS index 53ed4b6a8..182347166 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ New in 0.93: if the passwords match. * Support for booting Linux is rewritten, so GRUB now supports large-EBDA systems. +* The menu interfaces supports Page Up, Page Down, and Right Key. New in 0.92 - 2002-04-30: * The command "displaymem" uses only hex digits for consistency. diff --git a/THANKS b/THANKS index 20d1a28c2..f0f0d6b08 100644 --- a/THANKS +++ b/THANKS @@ -6,6 +6,7 @@ The following people made especially gracious contributions of their time and energy in helping to track down bugs, add new features, and generally assist in the GRUB maintainership process: +Adam Lackorzynski Adrian Phillips Alessandro Rubini Alexander K. Hudek diff --git a/grub/asmstub.c b/grub/asmstub.c index 7cb1183a8..2022357ea 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -627,6 +627,10 @@ console_translate_key (int c) return 1; case KEY_END: return 5; + case KEY_PPAGE: + return 7; + case KEY_NPAGE: + return 3; default: break; } diff --git a/stage2/asm.S b/stage2/asm.S index 983acd33a..6a04e4640 100644 --- a/stage2/asm.S +++ b/stage2/asm.S @@ -1920,6 +1920,8 @@ translation_table: .word KEY_END, 5 .word KEY_DC, 4 .word KEY_BACKSPACE, 8 + .word KEY_PPAGE, 7 + .word KEY_NPAGE, 3 .word 0 /* diff --git a/stage2/serial.c b/stage2/serial.c index 32ad20be3..973015e42 100644 --- a/stage2/serial.c +++ b/stage2/serial.c @@ -218,7 +218,9 @@ serial_translate_key_sequence (void) four_code_table[] = { {('1' | ('~' << 8)), 1}, - {('3' | ('~' << 8)), 4} + {('3' | ('~' << 8)), 4}, + {('5' | ('~' << 8)), 7}, + {('6' | ('~' << 8)), 3}, }; /* The buffer must start with ``ESC [''. */ diff --git a/stage2/stage2.c b/stage2/stage2.c index 8446c4d81..90fd03b7c 100644 --- a/stage2/stage2.c +++ b/stage2/stage2.c @@ -447,10 +447,36 @@ restart: } } } + else if (c == 7) + { + /* Page Up */ + first_entry -= 12; + if (first_entry < 0) + { + entryno += first_entry; + first_entry = 0; + if (entryno < 0) + entryno = 0; + } + print_entries (3, 12, first_entry, entryno, menu_entries); + } + else if (c == 3) + { + /* Page Down */ + first_entry += 12; + if (first_entry + entryno + 1 >= num_entries) + { + first_entry = num_entries - 12; + if (first_entry < 0) + first_entry = 0; + entryno = num_entries - first_entry - 1; + } + print_entries (3, 12, first_entry, entryno, menu_entries); + } if (config_entries) { - if ((c == '\n') || (c == '\r')) + if ((c == '\n') || (c == '\r') || (c == 6)) break; } else