bindings: allow typing digits on the numeric keypad by holding Shift
Until now, on an xterm, Shift plus any keypad key would say "Unknown sequence", which is not useful. On other terminal emulators (urxvt, Pantheon, LXTerminal), Shift plus a keypad key already produces the relevant digit or symbol, so this change harmonizes the behavior of the different emulators. However, on a Linux console, Shift plus a keypad key moves the cursor and selects the text that is passed over. And holding Alt while pressing a keypad key does nothing at all.master
parent
ecb4dac494
commit
476c838753
15
src/winio.c
15
src/winio.c
|
@ -368,12 +368,19 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
/* ->->->->->->-> */
|
/* ->->->->->->-> */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2': /* Shift */
|
||||||
if (length > 2)
|
case '4': /* Shift+Alt */
|
||||||
|
case '6': /* Shift+Ctrl */
|
||||||
|
if (length > 2) {
|
||||||
*consumed = 3;
|
*consumed = 3;
|
||||||
|
/* Allow typing digits on the numeric keypad without
|
||||||
|
* engaging NumLock. Esc O 2 p == Shift-0, .... */
|
||||||
|
return (seq[2] - 0x40);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '3':
|
case '3': /* Alt */
|
||||||
case '5':
|
case '5': /* Ctrl */
|
||||||
|
case '7': /* Alt+Ctrl */
|
||||||
if (length > 2) {
|
if (length > 2) {
|
||||||
*consumed = 3;
|
*consumed = 3;
|
||||||
switch (seq[2]) {
|
switch (seq[2]) {
|
||||||
|
|
Loading…
Reference in New Issue