macroify keys in ncusest terminal code

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-05-08 01:08:58 +02:00
parent 3c151d94af
commit 2dd54ae21d

View file

@ -146,19 +146,19 @@ grub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused)))
switch (c) switch (c)
{ {
case KEY_LEFT: case KEY_LEFT:
c = 2; c = GRUB_TERM_LEFT;
break; break;
case KEY_RIGHT: case KEY_RIGHT:
c = 6; c = GRUB_TERM_RIGHT;
break; break;
case KEY_UP: case KEY_UP:
c = 16; c = GRUB_TERM_UP;
break; break;
case KEY_DOWN: case KEY_DOWN:
c = 14; c = GRUB_TERM_DOWN;
break; break;
case KEY_IC: case KEY_IC:
@ -166,30 +166,30 @@ grub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused)))
break; break;
case KEY_DC: case KEY_DC:
c = 4; c = GRUB_TERM_DC;
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 = 8; c = GRUB_TERM_BACKSPACE;
break; break;
case KEY_HOME: case KEY_HOME:
c = 1; c = GRUB_TERM_HOME;
break; break;
case KEY_END: case KEY_END:
c = 5; c = GRUB_TERM_END;
break; break;
case KEY_NPAGE: case KEY_NPAGE:
c = 3; c = GRUB_TERM_NPAGE;
break; break;
case KEY_PPAGE: case KEY_PPAGE:
c = 7; c = GRUB_TERM_PPAGE;
break; break;
} }