From 1593e10c1e5f219d51d9fe64037d3fe7c2046cfe Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 18 Nov 2007 07:20:45 +0000 Subject: [PATCH] 2007-11-18 Christian Franke * 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. --- ChangeLog | 6 ++++++ util/console.c | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 114821ae8..8487f0894 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-11-18 Christian Franke + + * 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 * disk/host.c (grub_host_open): Remove attribute unused from diff --git a/util/console.c b/util/console.c index 469781a1b..8c9401c1d 100644 --- a/util/console.c +++ b/util/console.c @@ -164,50 +164,50 @@ grub_ncurses_getkey (void) switch (c) { case KEY_LEFT: - c = GRUB_CONSOLE_KEY_LEFT; + c = 2; break; case KEY_RIGHT: - c = GRUB_CONSOLE_KEY_RIGHT; + c = 6; break; case KEY_UP: - c = GRUB_CONSOLE_KEY_UP; + c = 16; break; case KEY_DOWN: - c = GRUB_CONSOLE_KEY_DOWN; + c = 14; break; case KEY_IC: - c = GRUB_CONSOLE_KEY_IC; + c = 24; break; case KEY_DC: - c = GRUB_CONSOLE_KEY_DC; + c = 4; 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; break; case KEY_HOME: - c = GRUB_CONSOLE_KEY_HOME; + c = 1; break; case KEY_END: - c = GRUB_CONSOLE_KEY_END; + c = 5; break; case KEY_NPAGE: - c = GRUB_CONSOLE_KEY_NPAGE; + c = 3; break; case KEY_PPAGE: - c = GRUB_CONSOLE_KEY_PPAGE; + c = 7; break; }