mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 00:23:08 +01:00
Permit S- prefix on keys for shift. Relatively few terminals support this
(basically xterm only) and even fewer have them in terminfo (kLFT2 and kRIT2).
This commit is contained in:
parent
8f301ed62d
commit
d5d0a36f66
19
key-string.c
19
key-string.c
@ -170,6 +170,25 @@ key_string_lookup_string(const char *string)
|
|||||||
return (KEYC_NONE);
|
return (KEYC_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((string[0] == 'S' || string[0] == 's') && string[1] == '-') {
|
||||||
|
ptr = string + 2;
|
||||||
|
if (ptr[0] == '\0')
|
||||||
|
return (KEYC_NONE);
|
||||||
|
key = key_string_lookup_string(ptr);
|
||||||
|
if (key != KEYC_NONE) {
|
||||||
|
if (key >= KEYC_BASE)
|
||||||
|
return (key | KEYC_SHIFT);
|
||||||
|
} else {
|
||||||
|
if (ptr[1] == '\0')
|
||||||
|
return (KEYC_NONE);
|
||||||
|
key = (u_char) ptr[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key >= 32 && key <= 127)
|
||||||
|
return (key | KEYC_SHIFT);
|
||||||
|
return (KEYC_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
return (key_string_search_table(string));
|
return (key_string_search_table(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user