Match extended keyboard protocol modifier bitmask with the CSIu protocol from xterm
This commit is contained in:
parent
5392ceea7d
commit
1f9acf99b0
5796
kitty/keys.h
5796
kitty/keys.h
File diff suppressed because it is too large
Load Diff
@ -133,8 +133,17 @@ def extended_key_event(key, mods, action):
|
||||
name = KEY_MAP.get(key)
|
||||
if name is None:
|
||||
return b''
|
||||
m = 0
|
||||
if mods & defines.GLFW_MOD_SHIFT:
|
||||
m |= 0x1
|
||||
if mods & defines.GLFW_MOD_ALT:
|
||||
m |= 0x2
|
||||
if mods & defines.GLFW_MOD_CONTROL:
|
||||
m |= 0x4
|
||||
if mods & defines.GLFW_MOD_SUPER:
|
||||
m |= 0x8
|
||||
return '\033_K{}{}{}\033\\'.format(
|
||||
action_map[action], base64_encode(mods), name
|
||||
action_map[action], base64_encode(m), name
|
||||
).encode('ascii')
|
||||
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ The escape sequence encodes the following properties:
|
||||
|
||||
Where `<type>` is one of `p` -- press, `r` -- release and `t` -- repeat.
|
||||
Modifiers is a bitmask represented as a single base64 digit. Shift -- `0x1`,
|
||||
Control -- `0x2`, Alt -- `0x4` and Super -- `0x8`. `<key>` is a number
|
||||
Alt -- `0x2`, Control -- `0x4` and Super -- `0x8`. `<key>` is a number
|
||||
(encoded in base85) corresponding to the key pressed. The key name to number
|
||||
mapping is defined in link:key_encoding.asciidoc[this table].
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user