mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
Match extended keyboard protocol modifier bitmask with the CSIu protocol from xterm
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user