mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
Fix Shift+function key not working
Also support pressing F13-f25 function keys. Fixes #485
This commit is contained in:
parent
9962ac2703
commit
fda57a81e1
1552
kitty/keys.h
generated
1552
kitty/keys.h
generated
File diff suppressed because it is too large
Load Diff
@ -37,6 +37,16 @@ def modify_complex_key(name, amt):
|
||||
alt_mods = (defines.GLFW_MOD_ALT, defines.GLFW_MOD_SHIFT | defines.GLFW_MOD_ALT)
|
||||
ctrl_shift_mod = defines.GLFW_MOD_SHIFT | defines.GLFW_MOD_CONTROL
|
||||
ctrl_alt_mod = defines.GLFW_MOD_ALT | defines.GLFW_MOD_CONTROL
|
||||
SHIFTED_KEYS = {
|
||||
defines.GLFW_KEY_TAB: key_as_bytes('kcbt'),
|
||||
defines.GLFW_KEY_HOME: key_as_bytes('kHOM'),
|
||||
defines.GLFW_KEY_END: key_as_bytes('kEND'),
|
||||
defines.GLFW_KEY_LEFT: key_as_bytes('kLFT'),
|
||||
defines.GLFW_KEY_RIGHT: key_as_bytes('kRIT'),
|
||||
defines.GLFW_KEY_UP: key_as_bytes('kri'),
|
||||
defines.GLFW_KEY_DOWN: key_as_bytes('kind'),
|
||||
}
|
||||
|
||||
|
||||
for kf, kn in {
|
||||
defines.GLFW_KEY_UP: 'kcuu1',
|
||||
@ -58,9 +68,14 @@ def modify_complex_key(name, amt):
|
||||
kf = getattr(defines, 'GLFW_KEY_F{}'.format(f))
|
||||
kn = 'kf{}'.format(f)
|
||||
smkx_key_map[kf] = key_as_bytes(kn)
|
||||
SHIFTED_KEYS[kf] = modify_complex_key(kn, 2)
|
||||
alt_codes[kf] = modify_complex_key(kn, 3)
|
||||
shift_alt_codes[kf] = modify_complex_key(kn, 4)
|
||||
control_codes[kf] = modify_complex_key(kn, 5)
|
||||
for f in range(13, 26):
|
||||
kf = getattr(defines, 'GLFW_KEY_F{}'.format(f))
|
||||
kn = 'kf{}'.format(f)
|
||||
smkx_key_map[kf] = key_as_bytes(kn)
|
||||
f = {k: k for k in '0123456789'}
|
||||
f.update({
|
||||
'COMMA': ',',
|
||||
@ -80,16 +95,6 @@ def modify_complex_key(name, amt):
|
||||
smkx_key_map[defines.GLFW_KEY_BACKSPACE] = key_as_bytes('kbs')
|
||||
smkx_key_map[defines.GLFW_KEY_TAB] = b'\t'
|
||||
|
||||
SHIFTED_KEYS = {
|
||||
defines.GLFW_KEY_TAB: key_as_bytes('kcbt'),
|
||||
defines.GLFW_KEY_HOME: key_as_bytes('kHOM'),
|
||||
defines.GLFW_KEY_END: key_as_bytes('kEND'),
|
||||
defines.GLFW_KEY_LEFT: key_as_bytes('kLFT'),
|
||||
defines.GLFW_KEY_RIGHT: key_as_bytes('kRIT'),
|
||||
defines.GLFW_KEY_UP: key_as_bytes('kri'),
|
||||
defines.GLFW_KEY_DOWN: key_as_bytes('kind'),
|
||||
}
|
||||
|
||||
control_codes.update({
|
||||
k: (1 + i, )
|
||||
for i, k in
|
||||
|
@ -173,6 +173,19 @@
|
||||
'kf10': r'\E[21~',
|
||||
'kf11': r'\E[23~',
|
||||
'kf12': r'\E[24~',
|
||||
'kf13': r'\E[1;2P',
|
||||
'kf14': r'\E[1;2Q',
|
||||
'kf15': r'\E[1;2R',
|
||||
'kf16': r'\E[1;2S',
|
||||
'kf17': r'\E[15;2~',
|
||||
'kf18': r'\E[17;2~',
|
||||
'kf19': r'\E[18;2~',
|
||||
'kf20': r'\E[19;2~',
|
||||
'kf21': r'\E[20;2~',
|
||||
'kf22': r'\E[21;2~',
|
||||
'kf23': r'\E[23;2~',
|
||||
'kf24': r'\E[24;2~',
|
||||
'kf25': r'\E[1;5P',
|
||||
# Home
|
||||
'khome': r'\EOH',
|
||||
# End
|
||||
@ -345,6 +358,19 @@
|
||||
'k;': 'kf10',
|
||||
'F1': 'kf11',
|
||||
'F2': 'kf12',
|
||||
'F3': 'kf13',
|
||||
'F4': 'kf14',
|
||||
'F5': 'kf15',
|
||||
'F6': 'kf16',
|
||||
'F7': 'kf17',
|
||||
'F8': 'kf18',
|
||||
'F9': 'kf19',
|
||||
'FA': 'kf20',
|
||||
'FB': 'kf21',
|
||||
'FC': 'kf22',
|
||||
'FD': 'kf23',
|
||||
'FE': 'kf24',
|
||||
'FF': 'kf25',
|
||||
'kh': 'khome',
|
||||
'@7': 'kend',
|
||||
'kI': 'kich1',
|
||||
|
Binary file not shown.
@ -76,7 +76,20 @@ xterm-kitty|KovIdTTY,
|
||||
kf10=\E[21~,
|
||||
kf11=\E[23~,
|
||||
kf12=\E[24~,
|
||||
kf13=\E[1;2P,
|
||||
kf14=\E[1;2Q,
|
||||
kf15=\E[1;2R,
|
||||
kf16=\E[1;2S,
|
||||
kf17=\E[15;2~,
|
||||
kf18=\E[17;2~,
|
||||
kf19=\E[18;2~,
|
||||
kf2=\EOQ,
|
||||
kf20=\E[19;2~,
|
||||
kf21=\E[20;2~,
|
||||
kf22=\E[21;2~,
|
||||
kf23=\E[23;2~,
|
||||
kf24=\E[24;2~,
|
||||
kf25=\E[1;5P,
|
||||
kf3=\EOR,
|
||||
kf4=\EOS,
|
||||
kf5=\E[15~,
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user