--- grub2.orig/util/console.c 2007-07-22 01:32:31.000000000 +0200 +++ grub2/util/console.c 2007-10-13 16:13:46.000000000 +0200 @@ -161,53 +161,59 @@ grub_ncurses_getkey (void) c = getch (); } + /* XXX: return GRUB_CONSOLE_KEY_* does not work here, + grub_cmdline_get() does not check for these constants. + At least on i386-pc, GRUB_CONSOLE_KEY_* are in fact keyboard + scancodes which are converted into control chars by + grub_console_getkey(). */ + switch (c) { case KEY_LEFT: - c = GRUB_CONSOLE_KEY_LEFT; + c = 2; /*GRUB_CONSOLE_KEY_LEFT*/ break; case KEY_RIGHT: - c = GRUB_CONSOLE_KEY_RIGHT; + c = 6; /*GRUB_CONSOLE_KEY_RIGHT*/ break; case KEY_UP: - c = GRUB_CONSOLE_KEY_UP; + c = 16; /*GRUB_CONSOLE_KEY_UP*/ break; case KEY_DOWN: - c = GRUB_CONSOLE_KEY_DOWN; + c = 14; /*GRUB_CONSOLE_KEY_DOWN*/ break; case KEY_IC: - c = GRUB_CONSOLE_KEY_IC; + c = 24; /*GRUB_CONSOLE_KEY_IC*/ break; case KEY_DC: - c = GRUB_CONSOLE_KEY_DC; + c = 4; /*GRUB_CONSOLE_KEY_DC*/ break; case KEY_BACKSPACE: /* XXX: For some reason ncurses on xterm does not return KEY_BACKSPACE. */ case 127: - c = GRUB_CONSOLE_KEY_BACKSPACE; + c = 8; /*GRUB_CONSOLE_KEY_BACKSPACE*/; break; case KEY_HOME: - c = GRUB_CONSOLE_KEY_HOME; + c = 1; /*GRUB_CONSOLE_KEY_HOME*/ break; case KEY_END: - c = GRUB_CONSOLE_KEY_END; + c = 5; /*GRUB_CONSOLE_KEY_END*/ break; case KEY_NPAGE: - c = GRUB_CONSOLE_KEY_NPAGE; + c = 3; /*GRUB_CONSOLE_KEY_NPAGE*/ break; case KEY_PPAGE: - c = GRUB_CONSOLE_KEY_PPAGE; + c = 7; /*GRUB_CONSOLE_KEY_PPAGE*/ break; }