mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-08-16 18:10:32 +03:00
parent
084b028eac
commit
c989a7198b
@ -53,7 +53,7 @@ text, or using the following escape codes, for those keys that do not produce
|
||||
text (``CSI`` is the bytes ``0x1b 0x5b``)::
|
||||
|
||||
CSI number ; modifiers [u~]
|
||||
CSI 1; modifiers [ABCDFHPQRS]
|
||||
CSI 1; modifiers [ABCDEFHPQRS]
|
||||
0x0d - for the Enter key
|
||||
0x7f or 0x08 - for Backspace
|
||||
0x09 - for Tab
|
||||
@ -67,7 +67,7 @@ modifiers pressed for the key event. The encoding is described in the
|
||||
The second form is used for a few functional keys, such as the :kbd:`Home, End,
|
||||
Arrow keys and F1-F4`, they are enumerated in the :ref:`functional` table below.
|
||||
Note that if no modifiers are present the parameters are omitted entirely
|
||||
giving an escape code of the form ``CSI [ABCDFHPQRS]``.
|
||||
giving an escape code of the form ``CSI [ABCDEFHPQRS]``.
|
||||
|
||||
If you want support for more advanced features such as repeat and release
|
||||
events, alternate keys for shortcut matching et cetera, these can be turned on
|
||||
@ -289,7 +289,7 @@ With this flag turned on, all key events that do not generate text are
|
||||
represented in one of the following two forms::
|
||||
|
||||
CSI number; modifier u
|
||||
CSI 1; modifier [~ABCDFHPQRS]
|
||||
CSI 1; modifier [~ABCDEFHPQRS]
|
||||
|
||||
This makes it very easy to parse key events in an application. In particular,
|
||||
:kbd:`ctrl+c` will no longer generate the ``SIGINT`` signal, but instead be
|
||||
@ -380,8 +380,8 @@ Legacy functional keys
|
||||
These keys are encoded using three schemes::
|
||||
|
||||
CSI number ; modifier ~
|
||||
CSI 1 ; modifier {ABCDFHPQRS}
|
||||
SS3 {ABCDFHPQRS}
|
||||
CSI 1 ; modifier {ABCDEFHPQRS}
|
||||
SS3 {ABCDEFHPQRS}
|
||||
|
||||
In the above, if there are no modifiers, the modifier parameter is omitted.
|
||||
The modifier value is encoded as described in the :ref:`modifiers` section,
|
||||
@ -536,20 +536,21 @@ compatibility reasons.
|
||||
"KP_DOWN", "``57420 u``", "KP_PAGE_UP", "``57421 u``"
|
||||
"KP_PAGE_DOWN", "``57422 u``", "KP_HOME", "``57423 u``"
|
||||
"KP_END", "``57424 u``", "KP_INSERT", "``57425 u``"
|
||||
"KP_DELETE", "``57426 u``", "MEDIA_PLAY", "``57427 u``"
|
||||
"MEDIA_PAUSE", "``57428 u``", "MEDIA_PLAY_PAUSE", "``57429 u``"
|
||||
"MEDIA_REVERSE", "``57430 u``", "MEDIA_STOP", "``57431 u``"
|
||||
"MEDIA_FAST_FORWARD", "``57432 u``", "MEDIA_REWIND", "``57433 u``"
|
||||
"MEDIA_TRACK_NEXT", "``57434 u``", "MEDIA_TRACK_PREVIOUS", "``57435 u``"
|
||||
"MEDIA_RECORD", "``57436 u``", "LOWER_VOLUME", "``57437 u``"
|
||||
"RAISE_VOLUME", "``57438 u``", "MUTE_VOLUME", "``57439 u``"
|
||||
"LEFT_SHIFT", "``57440 u``", "LEFT_CONTROL", "``57441 u``"
|
||||
"LEFT_ALT", "``57442 u``", "LEFT_SUPER", "``57443 u``"
|
||||
"LEFT_HYPER", "``57444 u``", "LEFT_META", "``57445 u``"
|
||||
"RIGHT_SHIFT", "``57446 u``", "RIGHT_CONTROL", "``57447 u``"
|
||||
"RIGHT_ALT", "``57448 u``", "RIGHT_SUPER", "``57449 u``"
|
||||
"RIGHT_HYPER", "``57450 u``", "RIGHT_META", "``57451 u``"
|
||||
"ISO_LEVEL3_SHIFT", "``57452 u``", "ISO_LEVEL5_SHIFT", "``57453 u``"
|
||||
"KP_DELETE", "``57426 u``", "KP_BEGIN", "``1 E or 57427 ~``"
|
||||
"MEDIA_PLAY", "``57428 u``", "MEDIA_PAUSE", "``57429 u``"
|
||||
"MEDIA_PLAY_PAUSE", "``57430 u``", "MEDIA_REVERSE", "``57431 u``"
|
||||
"MEDIA_STOP", "``57432 u``", "MEDIA_FAST_FORWARD", "``57433 u``"
|
||||
"MEDIA_REWIND", "``57434 u``", "MEDIA_TRACK_NEXT", "``57435 u``"
|
||||
"MEDIA_TRACK_PREVIOUS", "``57436 u``", "MEDIA_RECORD", "``57437 u``"
|
||||
"LOWER_VOLUME", "``57438 u``", "RAISE_VOLUME", "``57439 u``"
|
||||
"MUTE_VOLUME", "``57440 u``", "LEFT_SHIFT", "``57441 u``"
|
||||
"LEFT_CONTROL", "``57442 u``", "LEFT_ALT", "``57443 u``"
|
||||
"LEFT_SUPER", "``57444 u``", "LEFT_HYPER", "``57445 u``"
|
||||
"LEFT_META", "``57446 u``", "RIGHT_SHIFT", "``57447 u``"
|
||||
"RIGHT_CONTROL", "``57448 u``", "RIGHT_ALT", "``57449 u``"
|
||||
"RIGHT_SUPER", "``57450 u``", "RIGHT_HYPER", "``57451 u``"
|
||||
"RIGHT_META", "``57452 u``", "ISO_LEVEL3_SHIFT", "``57453 u``"
|
||||
"ISO_LEVEL5_SHIFT", "``57454 u``"
|
||||
|
||||
.. end functional key table
|
||||
.. }}}
|
||||
|
@ -91,6 +91,7 @@
|
||||
kp_end KP_End - -
|
||||
kp_insert KP_Insert - -
|
||||
kp_delete KP_Delete - -
|
||||
kp_begin KP_Begin - -
|
||||
media_play XF86AudioPlay - -
|
||||
media_pause XF86AudioPause - -
|
||||
media_play_pause - - -
|
||||
@ -129,7 +130,7 @@
|
||||
'f11': 23, 'f12': 24, 'escape': 27, 'backspace': 127
|
||||
}
|
||||
different_trailer_functionals = {
|
||||
'up': 'A', 'down': 'B', 'right': 'C', 'left': 'D', 'end': 'F', 'home': 'H',
|
||||
'up': 'A', 'down': 'B', 'right': 'C', 'left': 'D', 'kp_begin': 'E', 'end': 'F', 'home': 'H',
|
||||
'f1': 'P', 'f2': 'Q', 'f3': 'R', 'f4': 'S', 'enter': 'u', 'tab': 'u',
|
||||
'backspace': 'u', 'escape': 'u'
|
||||
}
|
||||
@ -311,7 +312,7 @@ def generate_functional_table() -> None:
|
||||
csi_map = {v: name_to_code[k] for k, v in functional_encoding_overrides.items()}
|
||||
letter_trailer_codes = {
|
||||
v: functional_encoding_overrides.get(k, name_to_code.get(k))
|
||||
for k, v in different_trailer_functionals.items() if v in 'ABCDHFPQRSZ'}
|
||||
for k, v in different_trailer_functionals.items() if v in 'ABCDEHFPQRSZ'}
|
||||
text = f'functional_key_number_to_name_map = {serialize_dict(code_to_name)}'
|
||||
text += f'\ncsi_number_to_functional_number_map = {serialize_dict(csi_map)}'
|
||||
text += f'\nletter_trailer_to_csi_number_map = {letter_trailer_codes!r}'
|
||||
|
57
glfw/glfw3.h
vendored
57
glfw/glfw3.h
vendored
@ -428,34 +428,35 @@ typedef enum {
|
||||
GLFW_FKEY_KP_END = 0xe050u,
|
||||
GLFW_FKEY_KP_INSERT = 0xe051u,
|
||||
GLFW_FKEY_KP_DELETE = 0xe052u,
|
||||
GLFW_FKEY_MEDIA_PLAY = 0xe053u,
|
||||
GLFW_FKEY_MEDIA_PAUSE = 0xe054u,
|
||||
GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe055u,
|
||||
GLFW_FKEY_MEDIA_REVERSE = 0xe056u,
|
||||
GLFW_FKEY_MEDIA_STOP = 0xe057u,
|
||||
GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe058u,
|
||||
GLFW_FKEY_MEDIA_REWIND = 0xe059u,
|
||||
GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05au,
|
||||
GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05bu,
|
||||
GLFW_FKEY_MEDIA_RECORD = 0xe05cu,
|
||||
GLFW_FKEY_LOWER_VOLUME = 0xe05du,
|
||||
GLFW_FKEY_RAISE_VOLUME = 0xe05eu,
|
||||
GLFW_FKEY_MUTE_VOLUME = 0xe05fu,
|
||||
GLFW_FKEY_LEFT_SHIFT = 0xe060u,
|
||||
GLFW_FKEY_LEFT_CONTROL = 0xe061u,
|
||||
GLFW_FKEY_LEFT_ALT = 0xe062u,
|
||||
GLFW_FKEY_LEFT_SUPER = 0xe063u,
|
||||
GLFW_FKEY_LEFT_HYPER = 0xe064u,
|
||||
GLFW_FKEY_LEFT_META = 0xe065u,
|
||||
GLFW_FKEY_RIGHT_SHIFT = 0xe066u,
|
||||
GLFW_FKEY_RIGHT_CONTROL = 0xe067u,
|
||||
GLFW_FKEY_RIGHT_ALT = 0xe068u,
|
||||
GLFW_FKEY_RIGHT_SUPER = 0xe069u,
|
||||
GLFW_FKEY_RIGHT_HYPER = 0xe06au,
|
||||
GLFW_FKEY_RIGHT_META = 0xe06bu,
|
||||
GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06cu,
|
||||
GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06du,
|
||||
GLFW_FKEY_LAST = 0xe06du
|
||||
GLFW_FKEY_KP_BEGIN = 0xe053u,
|
||||
GLFW_FKEY_MEDIA_PLAY = 0xe054u,
|
||||
GLFW_FKEY_MEDIA_PAUSE = 0xe055u,
|
||||
GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe056u,
|
||||
GLFW_FKEY_MEDIA_REVERSE = 0xe057u,
|
||||
GLFW_FKEY_MEDIA_STOP = 0xe058u,
|
||||
GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe059u,
|
||||
GLFW_FKEY_MEDIA_REWIND = 0xe05au,
|
||||
GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05bu,
|
||||
GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05cu,
|
||||
GLFW_FKEY_MEDIA_RECORD = 0xe05du,
|
||||
GLFW_FKEY_LOWER_VOLUME = 0xe05eu,
|
||||
GLFW_FKEY_RAISE_VOLUME = 0xe05fu,
|
||||
GLFW_FKEY_MUTE_VOLUME = 0xe060u,
|
||||
GLFW_FKEY_LEFT_SHIFT = 0xe061u,
|
||||
GLFW_FKEY_LEFT_CONTROL = 0xe062u,
|
||||
GLFW_FKEY_LEFT_ALT = 0xe063u,
|
||||
GLFW_FKEY_LEFT_SUPER = 0xe064u,
|
||||
GLFW_FKEY_LEFT_HYPER = 0xe065u,
|
||||
GLFW_FKEY_LEFT_META = 0xe066u,
|
||||
GLFW_FKEY_RIGHT_SHIFT = 0xe067u,
|
||||
GLFW_FKEY_RIGHT_CONTROL = 0xe068u,
|
||||
GLFW_FKEY_RIGHT_ALT = 0xe069u,
|
||||
GLFW_FKEY_RIGHT_SUPER = 0xe06au,
|
||||
GLFW_FKEY_RIGHT_HYPER = 0xe06bu,
|
||||
GLFW_FKEY_RIGHT_META = 0xe06cu,
|
||||
GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06du,
|
||||
GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06eu,
|
||||
GLFW_FKEY_LAST = 0xe06eu
|
||||
} GLFWFunctionKey;
|
||||
/* end functional key names */
|
||||
|
||||
|
1
glfw/input.c
vendored
1
glfw/input.c
vendored
@ -607,6 +607,7 @@ _glfwGetKeyName(int key)
|
||||
case GLFW_FKEY_KP_END: return "KP_END";
|
||||
case GLFW_FKEY_KP_INSERT: return "KP_INSERT";
|
||||
case GLFW_FKEY_KP_DELETE: return "KP_DELETE";
|
||||
case GLFW_FKEY_KP_BEGIN: return "KP_BEGIN";
|
||||
case GLFW_FKEY_MEDIA_PLAY: return "MEDIA_PLAY";
|
||||
case GLFW_FKEY_MEDIA_PAUSE: return "MEDIA_PAUSE";
|
||||
case GLFW_FKEY_MEDIA_PLAY_PAUSE: return "MEDIA_PLAY_PAUSE";
|
||||
|
2
glfw/xkb_glfw.c
vendored
2
glfw/xkb_glfw.c
vendored
@ -128,6 +128,7 @@ glfw_key_for_sym(xkb_keysym_t key) {
|
||||
case XKB_KEY_KP_End: return GLFW_FKEY_KP_END;
|
||||
case XKB_KEY_KP_Insert: return GLFW_FKEY_KP_INSERT;
|
||||
case XKB_KEY_KP_Delete: return GLFW_FKEY_KP_DELETE;
|
||||
case XKB_KEY_KP_Begin: return GLFW_FKEY_KP_BEGIN;
|
||||
case XKB_KEY_XF86AudioPlay: return GLFW_FKEY_MEDIA_PLAY;
|
||||
case XKB_KEY_XF86AudioPause: return GLFW_FKEY_MEDIA_PAUSE;
|
||||
case XKB_KEY_XF86AudioStop: return GLFW_FKEY_MEDIA_STOP;
|
||||
@ -246,6 +247,7 @@ glfw_xkb_sym_for_key(uint32_t key) {
|
||||
case GLFW_FKEY_KP_END: return XKB_KEY_KP_End;
|
||||
case GLFW_FKEY_KP_INSERT: return XKB_KEY_KP_Insert;
|
||||
case GLFW_FKEY_KP_DELETE: return XKB_KEY_KP_Delete;
|
||||
case GLFW_FKEY_KP_BEGIN: return XKB_KEY_KP_Begin;
|
||||
case GLFW_FKEY_MEDIA_PLAY: return XKB_KEY_XF86AudioPlay;
|
||||
case GLFW_FKEY_MEDIA_PAUSE: return XKB_KEY_XF86AudioPause;
|
||||
case GLFW_FKEY_MEDIA_STOP: return XKB_KEY_XF86AudioStop;
|
||||
|
@ -277,7 +277,7 @@ def _on_csi(self, csi: str) -> None:
|
||||
pass
|
||||
else:
|
||||
self.handler.on_mouse(ev)
|
||||
elif q in 'u~ABCDHFPQRS':
|
||||
elif q in 'u~ABCDEHFPQRS':
|
||||
if csi == '200~':
|
||||
self.in_bracketed_paste = True
|
||||
return
|
||||
|
@ -101,6 +101,7 @@ GLFW_FKEY_KP_HOME: int
|
||||
GLFW_FKEY_KP_END: int
|
||||
GLFW_FKEY_KP_INSERT: int
|
||||
GLFW_FKEY_KP_DELETE: int
|
||||
GLFW_FKEY_KP_BEGIN: int
|
||||
GLFW_FKEY_MEDIA_PLAY: int
|
||||
GLFW_FKEY_MEDIA_PAUSE: int
|
||||
GLFW_FKEY_MEDIA_PLAY_PAUSE: int
|
||||
|
57
kitty/glfw-wrapper.h
generated
57
kitty/glfw-wrapper.h
generated
@ -166,34 +166,35 @@ typedef enum {
|
||||
GLFW_FKEY_KP_END = 0xe050u,
|
||||
GLFW_FKEY_KP_INSERT = 0xe051u,
|
||||
GLFW_FKEY_KP_DELETE = 0xe052u,
|
||||
GLFW_FKEY_MEDIA_PLAY = 0xe053u,
|
||||
GLFW_FKEY_MEDIA_PAUSE = 0xe054u,
|
||||
GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe055u,
|
||||
GLFW_FKEY_MEDIA_REVERSE = 0xe056u,
|
||||
GLFW_FKEY_MEDIA_STOP = 0xe057u,
|
||||
GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe058u,
|
||||
GLFW_FKEY_MEDIA_REWIND = 0xe059u,
|
||||
GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05au,
|
||||
GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05bu,
|
||||
GLFW_FKEY_MEDIA_RECORD = 0xe05cu,
|
||||
GLFW_FKEY_LOWER_VOLUME = 0xe05du,
|
||||
GLFW_FKEY_RAISE_VOLUME = 0xe05eu,
|
||||
GLFW_FKEY_MUTE_VOLUME = 0xe05fu,
|
||||
GLFW_FKEY_LEFT_SHIFT = 0xe060u,
|
||||
GLFW_FKEY_LEFT_CONTROL = 0xe061u,
|
||||
GLFW_FKEY_LEFT_ALT = 0xe062u,
|
||||
GLFW_FKEY_LEFT_SUPER = 0xe063u,
|
||||
GLFW_FKEY_LEFT_HYPER = 0xe064u,
|
||||
GLFW_FKEY_LEFT_META = 0xe065u,
|
||||
GLFW_FKEY_RIGHT_SHIFT = 0xe066u,
|
||||
GLFW_FKEY_RIGHT_CONTROL = 0xe067u,
|
||||
GLFW_FKEY_RIGHT_ALT = 0xe068u,
|
||||
GLFW_FKEY_RIGHT_SUPER = 0xe069u,
|
||||
GLFW_FKEY_RIGHT_HYPER = 0xe06au,
|
||||
GLFW_FKEY_RIGHT_META = 0xe06bu,
|
||||
GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06cu,
|
||||
GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06du,
|
||||
GLFW_FKEY_LAST = 0xe06du
|
||||
GLFW_FKEY_KP_BEGIN = 0xe053u,
|
||||
GLFW_FKEY_MEDIA_PLAY = 0xe054u,
|
||||
GLFW_FKEY_MEDIA_PAUSE = 0xe055u,
|
||||
GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe056u,
|
||||
GLFW_FKEY_MEDIA_REVERSE = 0xe057u,
|
||||
GLFW_FKEY_MEDIA_STOP = 0xe058u,
|
||||
GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe059u,
|
||||
GLFW_FKEY_MEDIA_REWIND = 0xe05au,
|
||||
GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05bu,
|
||||
GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05cu,
|
||||
GLFW_FKEY_MEDIA_RECORD = 0xe05du,
|
||||
GLFW_FKEY_LOWER_VOLUME = 0xe05eu,
|
||||
GLFW_FKEY_RAISE_VOLUME = 0xe05fu,
|
||||
GLFW_FKEY_MUTE_VOLUME = 0xe060u,
|
||||
GLFW_FKEY_LEFT_SHIFT = 0xe061u,
|
||||
GLFW_FKEY_LEFT_CONTROL = 0xe062u,
|
||||
GLFW_FKEY_LEFT_ALT = 0xe063u,
|
||||
GLFW_FKEY_LEFT_SUPER = 0xe064u,
|
||||
GLFW_FKEY_LEFT_HYPER = 0xe065u,
|
||||
GLFW_FKEY_LEFT_META = 0xe066u,
|
||||
GLFW_FKEY_RIGHT_SHIFT = 0xe067u,
|
||||
GLFW_FKEY_RIGHT_CONTROL = 0xe068u,
|
||||
GLFW_FKEY_RIGHT_ALT = 0xe069u,
|
||||
GLFW_FKEY_RIGHT_SUPER = 0xe06au,
|
||||
GLFW_FKEY_RIGHT_HYPER = 0xe06bu,
|
||||
GLFW_FKEY_RIGHT_META = 0xe06cu,
|
||||
GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06du,
|
||||
GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06eu,
|
||||
GLFW_FKEY_LAST = 0xe06eu
|
||||
} GLFWFunctionKey;
|
||||
/* end functional key names */
|
||||
|
||||
|
@ -1019,6 +1019,7 @@ glfw_get_key_name(PyObject UNUSED *self, PyObject *args) {
|
||||
case GLFW_FKEY_KP_END: return PyUnicode_FromString("kp_end");
|
||||
case GLFW_FKEY_KP_INSERT: return PyUnicode_FromString("kp_insert");
|
||||
case GLFW_FKEY_KP_DELETE: return PyUnicode_FromString("kp_delete");
|
||||
case GLFW_FKEY_KP_BEGIN: return PyUnicode_FromString("kp_begin");
|
||||
case GLFW_FKEY_MEDIA_PLAY: return PyUnicode_FromString("media_play");
|
||||
case GLFW_FKEY_MEDIA_PAUSE: return PyUnicode_FromString("media_pause");
|
||||
case GLFW_FKEY_MEDIA_PLAY_PAUSE: return PyUnicode_FromString("media_play_pause");
|
||||
@ -1530,6 +1531,7 @@ init_glfw(PyObject *m) {
|
||||
ADDC(GLFW_FKEY_KP_END);
|
||||
ADDC(GLFW_FKEY_KP_INSERT);
|
||||
ADDC(GLFW_FKEY_KP_DELETE);
|
||||
ADDC(GLFW_FKEY_KP_BEGIN);
|
||||
ADDC(GLFW_FKEY_MEDIA_PLAY);
|
||||
ADDC(GLFW_FKEY_MEDIA_PAUSE);
|
||||
ADDC(GLFW_FKEY_MEDIA_PLAY_PAUSE);
|
||||
|
@ -169,6 +169,7 @@ encode_function_key(const KeyEvent *ev, char *output) {
|
||||
case GLFW_FKEY_DOWN: SIMPLE("\x1bOB");
|
||||
case GLFW_FKEY_RIGHT: SIMPLE("\x1bOC");
|
||||
case GLFW_FKEY_LEFT: SIMPLE("\x1bOD");
|
||||
case GLFW_FKEY_KP_BEGIN: SIMPLE("\x1bOE");
|
||||
case GLFW_FKEY_END: SIMPLE("\x1bOF");
|
||||
case GLFW_FKEY_HOME: SIMPLE("\x1bOH");
|
||||
case GLFW_FKEY_F1: SIMPLE("\x1bOP");
|
||||
@ -222,6 +223,7 @@ encode_function_key(const KeyEvent *ev, char *output) {
|
||||
case GLFW_FKEY_F10: S(21, '~');
|
||||
case GLFW_FKEY_F11: S(23, '~');
|
||||
case GLFW_FKEY_F12: S(24, '~');
|
||||
case GLFW_FKEY_KP_BEGIN: S(1, 'E');
|
||||
/* end special numbers */
|
||||
default: break;
|
||||
}
|
||||
@ -426,7 +428,7 @@ encode_glfw_key_event(const GLFWkeyevent *e, const bool cursor_key_mode, const u
|
||||
ev.has_text = e->text && !startswith_ascii_control_char(e->text);
|
||||
if (!ev.key && !ev.has_text) return 0;
|
||||
bool send_text_standalone = !ev.report_text;
|
||||
if (!ev.disambiguate && GLFW_FKEY_KP_0 <= ev.key && ev.key <= GLFW_FKEY_KP_DELETE) {
|
||||
if (!ev.disambiguate && GLFW_FKEY_KP_0 <= ev.key && ev.key <= GLFW_FKEY_KP_BEGIN) {
|
||||
ev.key = convert_kp_key_to_normal_key(ev.key);
|
||||
}
|
||||
switch (e->action) {
|
||||
|
59
kitty/key_encoding.py
generated
59
kitty/key_encoding.py
generated
@ -97,33 +97,34 @@
|
||||
57424: 'KP_END',
|
||||
57425: 'KP_INSERT',
|
||||
57426: 'KP_DELETE',
|
||||
57427: 'MEDIA_PLAY',
|
||||
57428: 'MEDIA_PAUSE',
|
||||
57429: 'MEDIA_PLAY_PAUSE',
|
||||
57430: 'MEDIA_REVERSE',
|
||||
57431: 'MEDIA_STOP',
|
||||
57432: 'MEDIA_FAST_FORWARD',
|
||||
57433: 'MEDIA_REWIND',
|
||||
57434: 'MEDIA_TRACK_NEXT',
|
||||
57435: 'MEDIA_TRACK_PREVIOUS',
|
||||
57436: 'MEDIA_RECORD',
|
||||
57437: 'LOWER_VOLUME',
|
||||
57438: 'RAISE_VOLUME',
|
||||
57439: 'MUTE_VOLUME',
|
||||
57440: 'LEFT_SHIFT',
|
||||
57441: 'LEFT_CONTROL',
|
||||
57442: 'LEFT_ALT',
|
||||
57443: 'LEFT_SUPER',
|
||||
57444: 'LEFT_HYPER',
|
||||
57445: 'LEFT_META',
|
||||
57446: 'RIGHT_SHIFT',
|
||||
57447: 'RIGHT_CONTROL',
|
||||
57448: 'RIGHT_ALT',
|
||||
57449: 'RIGHT_SUPER',
|
||||
57450: 'RIGHT_HYPER',
|
||||
57451: 'RIGHT_META',
|
||||
57452: 'ISO_LEVEL3_SHIFT',
|
||||
57453: 'ISO_LEVEL5_SHIFT'}
|
||||
57427: 'KP_BEGIN',
|
||||
57428: 'MEDIA_PLAY',
|
||||
57429: 'MEDIA_PAUSE',
|
||||
57430: 'MEDIA_PLAY_PAUSE',
|
||||
57431: 'MEDIA_REVERSE',
|
||||
57432: 'MEDIA_STOP',
|
||||
57433: 'MEDIA_FAST_FORWARD',
|
||||
57434: 'MEDIA_REWIND',
|
||||
57435: 'MEDIA_TRACK_NEXT',
|
||||
57436: 'MEDIA_TRACK_PREVIOUS',
|
||||
57437: 'MEDIA_RECORD',
|
||||
57438: 'LOWER_VOLUME',
|
||||
57439: 'RAISE_VOLUME',
|
||||
57440: 'MUTE_VOLUME',
|
||||
57441: 'LEFT_SHIFT',
|
||||
57442: 'LEFT_CONTROL',
|
||||
57443: 'LEFT_ALT',
|
||||
57444: 'LEFT_SUPER',
|
||||
57445: 'LEFT_HYPER',
|
||||
57446: 'LEFT_META',
|
||||
57447: 'RIGHT_SHIFT',
|
||||
57448: 'RIGHT_CONTROL',
|
||||
57449: 'RIGHT_ALT',
|
||||
57450: 'RIGHT_SUPER',
|
||||
57451: 'RIGHT_HYPER',
|
||||
57452: 'RIGHT_META',
|
||||
57453: 'ISO_LEVEL3_SHIFT',
|
||||
57454: 'ISO_LEVEL5_SHIFT'}
|
||||
csi_number_to_functional_number_map = {
|
||||
2: 57348,
|
||||
3: 57349,
|
||||
@ -146,7 +147,7 @@
|
||||
24: 57375,
|
||||
27: 57344,
|
||||
127: 57347}
|
||||
letter_trailer_to_csi_number_map = {'A': 57352, 'B': 57353, 'C': 57351, 'D': 57350, 'F': 8, 'H': 7, 'P': 11, 'Q': 12, 'R': 13, 'S': 14}
|
||||
letter_trailer_to_csi_number_map = {'A': 57352, 'B': 57353, 'C': 57351, 'D': 57350, 'E': 57427, 'F': 8, 'H': 7, 'P': 11, 'Q': 12, 'R': 13, 'S': 14}
|
||||
tilde_trailers = {57348, 57349, 57354, 57355, 57368, 57369, 57370, 57371, 57372, 57373, 57374, 57375}
|
||||
# end csi mapping
|
||||
# }}}
|
||||
@ -286,7 +287,7 @@ def get_sub_sections(x: str, missing: int = 0) -> Tuple[int, ...]:
|
||||
mods = (second_section[0] - 1) if second_section else 0
|
||||
action = second_section[1] if len(second_section) > 1 else 1
|
||||
keynum = first_section[0]
|
||||
if csi_type in 'ABCDHFPQRS':
|
||||
if csi_type in 'ABCDEHFPQRS':
|
||||
keynum = letter_trailer_to_csi_number_map[csi_type]
|
||||
|
||||
def key_name(num: int) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user