tweaks: use hard-baked keycodes where possible

These keycodes have non-rebindable entries in the list of shortcuts, so
they will always be there -- no need for a function call to find them.
master
Benno Schulenberg 2016-09-01 09:46:50 +02:00
parent 7b7d2bf7c9
commit acd8809d71
1 changed files with 9 additions and 9 deletions

View File

@ -576,13 +576,13 @@ int parse_kbinput(WINDOW *win)
/* Slang doesn't support KEY_SLEFT. */ /* Slang doesn't support KEY_SLEFT. */
case KEY_SLEFT: case KEY_SLEFT:
shift_held = TRUE; shift_held = TRUE;
return sc_seq_or(do_left, keycode); return KEY_LEFT;
#endif #endif
#ifdef KEY_SRIGHT #ifdef KEY_SRIGHT
/* Slang doesn't support KEY_SRIGHT. */ /* Slang doesn't support KEY_SRIGHT. */
case KEY_SRIGHT: case KEY_SRIGHT:
shift_held = TRUE; shift_held = TRUE;
return sc_seq_or(do_right, keycode); return KEY_RIGHT;
#endif #endif
#ifdef KEY_SR #ifdef KEY_SR
#ifdef KEY_SUP #ifdef KEY_SUP
@ -591,7 +591,7 @@ int parse_kbinput(WINDOW *win)
#endif #endif
case KEY_SR: /* Scroll backward, on Xfce4-terminal. */ case KEY_SR: /* Scroll backward, on Xfce4-terminal. */
shift_held = TRUE; shift_held = TRUE;
return sc_seq_or(do_up_void, keycode); return KEY_UP;
#endif #endif
#ifdef KEY_SF #ifdef KEY_SF
#ifdef KEY_SDOWN #ifdef KEY_SDOWN
@ -600,7 +600,7 @@ int parse_kbinput(WINDOW *win)
#endif #endif
case KEY_SF: /* Scroll forward, on Xfce4-terminal. */ case KEY_SF: /* Scroll forward, on Xfce4-terminal. */
shift_held = TRUE; shift_held = TRUE;
return sc_seq_or(do_down_void, keycode); return KEY_DOWN;
#endif #endif
#ifdef KEY_SHOME #ifdef KEY_SHOME
/* HP-UX 10-11 and Slang don't support KEY_SHOME. */ /* HP-UX 10-11 and Slang don't support KEY_SHOME. */
@ -609,7 +609,7 @@ int parse_kbinput(WINDOW *win)
case SHIFT_HOME: case SHIFT_HOME:
shift_held = TRUE; shift_held = TRUE;
case KEY_A1: /* Home (7) on keypad with NumLock off. */ case KEY_A1: /* Home (7) on keypad with NumLock off. */
return sc_seq_or(do_home, keycode); return KEY_HOME;
#ifdef KEY_SEND #ifdef KEY_SEND
/* HP-UX 10-11 and Slang don't support KEY_SEND. */ /* HP-UX 10-11 and Slang don't support KEY_SEND. */
case KEY_SEND: case KEY_SEND:
@ -617,19 +617,19 @@ int parse_kbinput(WINDOW *win)
case SHIFT_END: case SHIFT_END:
shift_held = TRUE; shift_held = TRUE;
case KEY_C1: /* End (1) on keypad with NumLock off. */ case KEY_C1: /* End (1) on keypad with NumLock off. */
return sc_seq_or(do_end, keycode); return KEY_END;
#ifndef NANO_TINY #ifndef NANO_TINY
case SHIFT_PAGEUP: /* Fake key, from Shift+Alt+Up. */ case SHIFT_PAGEUP: /* Fake key, from Shift+Alt+Up. */
shift_held = TRUE; shift_held = TRUE;
#endif #endif
case KEY_A3: /* PageUp (9) on keypad with NumLock off. */ case KEY_A3: /* PageUp (9) on keypad with NumLock off. */
return sc_seq_or(do_page_up, keycode); return KEY_PPAGE;
#ifndef NANO_TINY #ifndef NANO_TINY
case SHIFT_PAGEDOWN: /* Fake key, from Shift+Alt+Down. */ case SHIFT_PAGEDOWN: /* Fake key, from Shift+Alt+Down. */
shift_held = TRUE; shift_held = TRUE;
#endif #endif
case KEY_C3: /* PageDown (3) on keypad with NumLock off. */ case KEY_C3: /* PageDown (3) on keypad with NumLock off. */
return sc_seq_or(do_page_down, keycode); return KEY_NPAGE;
#ifdef KEY_SDC #ifdef KEY_SDC
/* Slang doesn't support KEY_SDC. */ /* Slang doesn't support KEY_SDC. */
case KEY_SDC: case KEY_SDC:
@ -638,7 +638,7 @@ int parse_kbinput(WINDOW *win)
if (ISSET(REBIND_DELETE)) if (ISSET(REBIND_DELETE))
return sc_seq_or(do_delete, keycode); return sc_seq_or(do_delete, keycode);
else else
return sc_seq_or(do_backspace, keycode); return KEY_BACKSPACE;
#ifdef KEY_SIC #ifdef KEY_SIC
/* Slang doesn't support KEY_SIC. */ /* Slang doesn't support KEY_SIC. */
case KEY_SIC: case KEY_SIC: