--- grub/ChangeLog.03 Mon Oct 14 15:07:38 2002 +++ grub/ChangeLog Mon Oct 14 15:10:29 2002 @@ -1,5 +1,11 @@ 2002-10-14 Adam Lackorzynski + * stage2/stage2.c (run_menu): Add page up and page down support. + * stage2/asm.S (translation_table): Add 3 and 7 for page up and down. + * stage2/serial.c (serial_translate_key_sequence): Add page up and + down. + * grub/asmstub.c (console_translate_key): Likewise. + * stage2/stage2.c (run_menu): Display number of current entry in the right upper corner of the menu frame. --- grub/stage2/stage2.c.03 Fri Sep 27 15:29:20 2002 +++ grub/stage2/stage2.c Mon Oct 14 01:07:02 2002 @@ -460,6 +460,73 @@ } } + /* PAGE UP */ + if (c == 7 && !(current_term->flags & TERM_DUMB)) + { + if (first_entry > 11) + { + first_entry -= 12; + print_entries (3, 12, first_entry, entryno, menu_entries); + } + else if (first_entry) + { + print_entry (4 + entryno, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + if (entryno + first_entry - 12 < 0) + entryno = 0; + else + entryno = first_entry + entryno - 12; + first_entry = 0; + print_entries (3, 12, first_entry, entryno, menu_entries); + } + else if (entryno) + { + print_entry (4 + entryno, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + entryno = 0; + print_entry (4, 1, get_entry (menu_entries, 0, 0)); + + } + } + /* PAGE DOWN */ + else if (c == 3 && !(current_term->flags & TERM_DUMB)) + { + if (first_entry + 12 < num_entries) + { + if (first_entry + 23 < num_entries) + first_entry += 12; + else + { + print_entry (4 + entryno, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + if (entryno + first_entry + 12 >= num_entries) + entryno = 11; + else + entryno += 24 + first_entry - num_entries; + first_entry = num_entries - 12; + } + print_entries (3, 12, first_entry, entryno, menu_entries); + } + else if (first_entry + entryno + 1 != num_entries) + { + print_entry (4 + entryno, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + entryno = num_entries - first_entry - 1; + print_entry (4 + entryno, 1, + get_entry (menu_entries, + first_entry + entryno, + 0)); + } + } + if (config_entries) { if (c == 'r') --- grub/stage2/asm.S.03 12 Jul 2002 09:55:55 -0000 +++ grub/stage2/asm.S 13 Oct 2002 23:11:39 -0000 @@ -1920,6 +1921,8 @@ .word KEY_END, 5 .word KEY_DC, 4 .word KEY_BACKSPACE, 8 + .word KEY_PPAGE, 3 + .word KEY_NPAGE, 7 .word 0 /* --- grub/stage2/serial.c.03 13 Sep 2002 11:27:41 -0000 +++ grub/stage2/serial.c 13 Oct 2002 23:13:10 -0000 @@ -218,7 +218,9 @@ four_code_table[] = { {('1' | ('~' << 8)), 1}, - {('3' | ('~' << 8)), 4} + {('3' | ('~' << 8)), 4}, + {('6' | (126 << 8)), 3}, + {('5' | (126 << 8)), 7}, }; /* The buffer must start with ``ESC [''. */ --- grub/grub/asmstub.c.03 22 Aug 2002 05:59:55 -0000 +++ grub/grub/asmstub.c 14 Oct 2002 12:42:03 -0000 @@ -627,6 +627,10 @@ return 1; case KEY_END: return 5; + case KEY_NPAGE: + return 7; + case KEY_PPAGE: + return 3; default: break; }