tweaks: make a few more direct returns, and reshuffle another bit of code
parent
4c6b6cad99
commit
4c63ef204d
27
src/winio.c
27
src/winio.c
|
@ -967,10 +967,10 @@ int parse_kbinput(WINDOW *win)
|
||||||
case 'C': return CONTROL_RIGHT;
|
case 'C': return CONTROL_RIGHT;
|
||||||
case 'D': return CONTROL_LEFT;
|
case 'D': return CONTROL_LEFT;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
case 'a': keycode = shiftaltup; break;
|
case 'a': shift_held = TRUE; return KEY_PPAGE;
|
||||||
case 'b': keycode = shiftaltdown; break;
|
case 'b': shift_held = TRUE; return KEY_NPAGE;
|
||||||
case 'c': keycode = shiftaltright; break;
|
case 'c': shift_held = TRUE; return KEY_HOME;
|
||||||
case 'd': keycode = shiftaltleft; break;
|
case 'd': shift_held = TRUE; return KEY_END;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (key_buffer_len > 0 && *key_buffer != ESC_CODE &&
|
} else if (key_buffer_len > 0 && *key_buffer != ESC_CODE &&
|
||||||
|
@ -1004,15 +1004,16 @@ int parse_kbinput(WINDOW *win)
|
||||||
keycode = byte;
|
keycode = byte;
|
||||||
else
|
else
|
||||||
return byte;
|
return byte;
|
||||||
} else if (digit_count > 0) {
|
} else if (digit_count == 0) {
|
||||||
/* A non-digit in the middle of a byte sequence... */
|
/* If the second escape did not arrive alone, it is a Meta
|
||||||
;
|
* keystroke; otherwise, it is an "Esc Esc control". */
|
||||||
} else if (!solitary) {
|
if (!solitary) {
|
||||||
if (!shifted_metas)
|
if (!shifted_metas)
|
||||||
keycode = tolower(keycode);
|
keycode = tolower(keycode);
|
||||||
meta_key = TRUE;
|
meta_key = TRUE;
|
||||||
} else
|
} else
|
||||||
keycode = convert_to_control(keycode);
|
keycode = convert_to_control(keycode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keycode == controlleft)
|
if (keycode == controlleft)
|
||||||
|
|
Loading…
Reference in New Issue