2007-11-18 Christian Franke <franke@computer.org>

* util/console.c (grub_ncurses_getkey): Change curses KEY_* mapping,
	now return control chars instead of GRUB_CONSOLE_KEY_* constants.
	This fixes the problem that function keys did not work in grub-emu.
This commit is contained in:
robertmh 2007-11-18 07:20:45 +00:00
parent 3b8db1a82b
commit 1593e10c1e
2 changed files with 17 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2007-11-18 Christian Franke <franke@computer.org>
* util/console.c (grub_ncurses_getkey): Change curses KEY_* mapping,
now return control chars instead of GRUB_CONSOLE_KEY_* constants.
This fixes the problem that function keys did not work in grub-emu.
2007-11-18 Christian Franke <franke@computer.org> 2007-11-18 Christian Franke <franke@computer.org>
* disk/host.c (grub_host_open): Remove attribute unused from * disk/host.c (grub_host_open): Remove attribute unused from

View file

@ -164,50 +164,50 @@ grub_ncurses_getkey (void)
switch (c) switch (c)
{ {
case KEY_LEFT: case KEY_LEFT:
c = GRUB_CONSOLE_KEY_LEFT; c = 2;
break; break;
case KEY_RIGHT: case KEY_RIGHT:
c = GRUB_CONSOLE_KEY_RIGHT; c = 6;
break; break;
case KEY_UP: case KEY_UP:
c = GRUB_CONSOLE_KEY_UP; c = 16;
break; break;
case KEY_DOWN: case KEY_DOWN:
c = GRUB_CONSOLE_KEY_DOWN; c = 14;
break; break;
case KEY_IC: case KEY_IC:
c = GRUB_CONSOLE_KEY_IC; c = 24;
break; break;
case KEY_DC: case KEY_DC:
c = GRUB_CONSOLE_KEY_DC; c = 4;
break; break;
case KEY_BACKSPACE: case KEY_BACKSPACE:
/* XXX: For some reason ncurses on xterm does not return /* XXX: For some reason ncurses on xterm does not return
KEY_BACKSPACE. */ KEY_BACKSPACE. */
case 127: case 127:
c = GRUB_CONSOLE_KEY_BACKSPACE; c = 8;
break; break;
case KEY_HOME: case KEY_HOME:
c = GRUB_CONSOLE_KEY_HOME; c = 1;
break; break;
case KEY_END: case KEY_END:
c = GRUB_CONSOLE_KEY_END; c = 5;
break; break;
case KEY_NPAGE: case KEY_NPAGE:
c = GRUB_CONSOLE_KEY_NPAGE; c = 3;
break; break;
case KEY_PPAGE: case KEY_PPAGE:
c = GRUB_CONSOLE_KEY_PPAGE; c = 7;
break; break;
} }