esc also needs a low number

This commit is contained in:
Kovid Goyal 2021-01-12 13:42:12 +05:30
parent 1ec9a8b777
commit 7ba57ebf62
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 4 additions and 3 deletions

View File

@ -312,7 +312,7 @@ compatibility reasons.
.. csv-table:: Functional key codes
:header: "Name", "CSI sequence"
"ESCAPE", "CSI 57344 ... u"
"ESCAPE", "CSI 27 ... u"
"ENTER", "CSI 13 ... u"
"TAB", "CSI 9 ... u"
"BACKSPACE", "CSI 127 ... u"

View File

@ -117,12 +117,12 @@ functional_encoding_overrides = {
'insert': 2, 'delete': 3, 'page_up': 5, 'page_down': 6,
'home': 7, 'end': 8, 'tab': 9, 'f1': 11, 'f2': 12, 'enter': 13, 'f4': 14,
'f5': 15, 'f6': 17, 'f7': 18, 'f8': 19, 'f9': 20, 'f10': 21,
'f11': 23, 'f12': 24, 'backspace': 127
'f11': 23, 'f12': 24, 'escape': 27, 'backspace': 127
}
different_trailer_functionals = {
'up': 'A', 'down': 'B', 'right': 'C', 'left': 'D', 'end': 'F', 'home': 'H',
'f1': 'P', 'f2': 'Q', 'f3': 'R', 'f4': 'S', 'enter': 'u', 'tab': 'u',
'backspace': 'u'
'backspace': 'u', 'escape': 'u'
}
functional_key_names: List[str] = []
name_to_code: Dict[str, int] = {}

View File

@ -129,6 +129,7 @@ encode_function_key(const KeyEvent *ev, char *output) {
#define S(number, trailer) key_number = number; csi_trailer = trailer; break
switch(key_number) {
/* start special numbers (auto generated by gen-key-constants.py do not edit) */
case GLFW_FKEY_ESCAPE: S(27, 'u');
case GLFW_FKEY_ENTER: S(13, 'u');
case GLFW_FKEY_TAB: S(9, 'u');
case GLFW_FKEY_BACKSPACE: S(127, 'u');