Fix :kbd:ctrl+shift+special key not working in normal and application keyboard modes
Fixes #1114
This commit is contained in:
@@ -66,6 +66,9 @@ Changelog
|
|||||||
- Fix focusing neighboring windows in the grid layout with less than 4 windows
|
- Fix focusing neighboring windows in the grid layout with less than 4 windows
|
||||||
not working (:iss:`1115`)
|
not working (:iss:`1115`)
|
||||||
|
|
||||||
|
- Fix :kbd:`ctrl+shift+special` key not working in normal and application keyboard
|
||||||
|
modes (:iss:`1114`)
|
||||||
|
|
||||||
0.12.3 [2018-09-29]
|
0.12.3 [2018-09-29]
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
|||||||
80
kitty/keys.h
generated
80
kitty/keys.h
generated
@@ -856,25 +856,25 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
|
|||||||
case 53: // BACKSPACE
|
case 53: // BACKSPACE
|
||||||
return "\x01\x7f";
|
return "\x01\x7f";
|
||||||
case 54: // INSERT
|
case 54: // INSERT
|
||||||
return "\x04\x1b\x5b\x32\x7e";
|
return "\x06\x1b\x5b\x32\x3b\x36\x7e";
|
||||||
case 55: // DELETE
|
case 55: // DELETE
|
||||||
return "\x04\x1b\x5b\x33\x7e";
|
return "\x06\x1b\x5b\x33\x3b\x36\x7e";
|
||||||
case 56: // RIGHT
|
case 56: // RIGHT
|
||||||
return "\x03\x1b\x5b\x43";
|
return "\x06\x1b\x5b\x31\x3b\x36\x43";
|
||||||
case 57: // LEFT
|
case 57: // LEFT
|
||||||
return "\x03\x1b\x5b\x44";
|
return "\x06\x1b\x5b\x31\x3b\x36\x44";
|
||||||
case 58: // DOWN
|
case 58: // DOWN
|
||||||
return "\x03\x1b\x5b\x42";
|
return "\x06\x1b\x5b\x31\x3b\x36\x42";
|
||||||
case 59: // UP
|
case 59: // UP
|
||||||
return "\x03\x1b\x5b\x41";
|
return "\x06\x1b\x5b\x31\x3b\x36\x41";
|
||||||
case 60: // PAGE_UP
|
case 60: // PAGE_UP
|
||||||
return "\x04\x1b\x5b\x35\x7e";
|
return "\x06\x1b\x5b\x35\x3b\x36\x7e";
|
||||||
case 61: // PAGE_DOWN
|
case 61: // PAGE_DOWN
|
||||||
return "\x04\x1b\x5b\x36\x7e";
|
return "\x06\x1b\x5b\x36\x3b\x36\x7e";
|
||||||
case 62: // HOME
|
case 62: // HOME
|
||||||
return "\x03\x1b\x5b\x48";
|
return "\x06\x1b\x5b\x31\x3b\x36\x48";
|
||||||
case 63: // END
|
case 63: // END
|
||||||
return "\x03\x1b\x5b\x46";
|
return "\x06\x1b\x5b\x31\x3b\x36\x46";
|
||||||
case 69: // F1
|
case 69: // F1
|
||||||
return "\x03\x1b\x4f\x50";
|
return "\x03\x1b\x4f\x50";
|
||||||
case 70: // F2
|
case 70: // F2
|
||||||
@@ -2483,25 +2483,25 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
|
|||||||
case 53: // BACKSPACE
|
case 53: // BACKSPACE
|
||||||
return "\x01\x7f";
|
return "\x01\x7f";
|
||||||
case 54: // INSERT
|
case 54: // INSERT
|
||||||
return "\x04\x1b\x5b\x32\x7e";
|
return "\x06\x1b\x5b\x32\x3b\x36\x7e";
|
||||||
case 55: // DELETE
|
case 55: // DELETE
|
||||||
return "\x04\x1b\x5b\x33\x7e";
|
return "\x06\x1b\x5b\x33\x3b\x36\x7e";
|
||||||
case 56: // RIGHT
|
case 56: // RIGHT
|
||||||
return "\x03\x1b\x5b\x43";
|
return "\x06\x1b\x5b\x31\x3b\x36\x43";
|
||||||
case 57: // LEFT
|
case 57: // LEFT
|
||||||
return "\x03\x1b\x5b\x44";
|
return "\x06\x1b\x5b\x31\x3b\x36\x44";
|
||||||
case 58: // DOWN
|
case 58: // DOWN
|
||||||
return "\x03\x1b\x5b\x42";
|
return "\x06\x1b\x5b\x31\x3b\x36\x42";
|
||||||
case 59: // UP
|
case 59: // UP
|
||||||
return "\x03\x1b\x5b\x41";
|
return "\x06\x1b\x5b\x31\x3b\x36\x41";
|
||||||
case 60: // PAGE_UP
|
case 60: // PAGE_UP
|
||||||
return "\x04\x1b\x5b\x35\x7e";
|
return "\x06\x1b\x5b\x35\x3b\x36\x7e";
|
||||||
case 61: // PAGE_DOWN
|
case 61: // PAGE_DOWN
|
||||||
return "\x04\x1b\x5b\x36\x7e";
|
return "\x06\x1b\x5b\x36\x3b\x36\x7e";
|
||||||
case 62: // HOME
|
case 62: // HOME
|
||||||
return "\x03\x1b\x5b\x48";
|
return "\x06\x1b\x5b\x31\x3b\x36\x48";
|
||||||
case 63: // END
|
case 63: // END
|
||||||
return "\x03\x1b\x5b\x46";
|
return "\x06\x1b\x5b\x31\x3b\x36\x46";
|
||||||
case 69: // F1
|
case 69: // F1
|
||||||
return "\x03\x1b\x4f\x50";
|
return "\x03\x1b\x4f\x50";
|
||||||
case 70: // F2
|
case 70: // F2
|
||||||
@@ -4119,25 +4119,25 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
|
|||||||
case 53: // BACKSPACE
|
case 53: // BACKSPACE
|
||||||
return "\x01\x7f";
|
return "\x01\x7f";
|
||||||
case 54: // INSERT
|
case 54: // INSERT
|
||||||
return "\x04\x1b\x5b\x32\x7e";
|
return "\x06\x1b\x5b\x32\x3b\x36\x7e";
|
||||||
case 55: // DELETE
|
case 55: // DELETE
|
||||||
return "\x04\x1b\x5b\x33\x7e";
|
return "\x06\x1b\x5b\x33\x3b\x36\x7e";
|
||||||
case 56: // RIGHT
|
case 56: // RIGHT
|
||||||
return "\x03\x1b\x4f\x43";
|
return "\x06\x1b\x5b\x31\x3b\x36\x43";
|
||||||
case 57: // LEFT
|
case 57: // LEFT
|
||||||
return "\x03\x1b\x4f\x44";
|
return "\x06\x1b\x5b\x31\x3b\x36\x44";
|
||||||
case 58: // DOWN
|
case 58: // DOWN
|
||||||
return "\x03\x1b\x4f\x42";
|
return "\x06\x1b\x5b\x31\x3b\x36\x42";
|
||||||
case 59: // UP
|
case 59: // UP
|
||||||
return "\x03\x1b\x4f\x41";
|
return "\x06\x1b\x5b\x31\x3b\x36\x41";
|
||||||
case 60: // PAGE_UP
|
case 60: // PAGE_UP
|
||||||
return "\x04\x1b\x5b\x35\x7e";
|
return "\x06\x1b\x5b\x35\x3b\x36\x7e";
|
||||||
case 61: // PAGE_DOWN
|
case 61: // PAGE_DOWN
|
||||||
return "\x04\x1b\x5b\x36\x7e";
|
return "\x06\x1b\x5b\x36\x3b\x36\x7e";
|
||||||
case 62: // HOME
|
case 62: // HOME
|
||||||
return "\x03\x1b\x4f\x48";
|
return "\x06\x1b\x5b\x31\x3b\x36\x48";
|
||||||
case 63: // END
|
case 63: // END
|
||||||
return "\x03\x1b\x4f\x46";
|
return "\x06\x1b\x5b\x31\x3b\x36\x46";
|
||||||
case 69: // F1
|
case 69: // F1
|
||||||
return "\x03\x1b\x4f\x50";
|
return "\x03\x1b\x4f\x50";
|
||||||
case 70: // F2
|
case 70: // F2
|
||||||
@@ -5746,25 +5746,25 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
|
|||||||
case 53: // BACKSPACE
|
case 53: // BACKSPACE
|
||||||
return "\x01\x7f";
|
return "\x01\x7f";
|
||||||
case 54: // INSERT
|
case 54: // INSERT
|
||||||
return "\x04\x1b\x5b\x32\x7e";
|
return "\x06\x1b\x5b\x32\x3b\x36\x7e";
|
||||||
case 55: // DELETE
|
case 55: // DELETE
|
||||||
return "\x04\x1b\x5b\x33\x7e";
|
return "\x06\x1b\x5b\x33\x3b\x36\x7e";
|
||||||
case 56: // RIGHT
|
case 56: // RIGHT
|
||||||
return "\x03\x1b\x4f\x43";
|
return "\x06\x1b\x5b\x31\x3b\x36\x43";
|
||||||
case 57: // LEFT
|
case 57: // LEFT
|
||||||
return "\x03\x1b\x4f\x44";
|
return "\x06\x1b\x5b\x31\x3b\x36\x44";
|
||||||
case 58: // DOWN
|
case 58: // DOWN
|
||||||
return "\x03\x1b\x4f\x42";
|
return "\x06\x1b\x5b\x31\x3b\x36\x42";
|
||||||
case 59: // UP
|
case 59: // UP
|
||||||
return "\x03\x1b\x4f\x41";
|
return "\x06\x1b\x5b\x31\x3b\x36\x41";
|
||||||
case 60: // PAGE_UP
|
case 60: // PAGE_UP
|
||||||
return "\x04\x1b\x5b\x35\x7e";
|
return "\x06\x1b\x5b\x35\x3b\x36\x7e";
|
||||||
case 61: // PAGE_DOWN
|
case 61: // PAGE_DOWN
|
||||||
return "\x04\x1b\x5b\x36\x7e";
|
return "\x06\x1b\x5b\x36\x3b\x36\x7e";
|
||||||
case 62: // HOME
|
case 62: // HOME
|
||||||
return "\x03\x1b\x4f\x48";
|
return "\x06\x1b\x5b\x31\x3b\x36\x48";
|
||||||
case 63: // END
|
case 63: // END
|
||||||
return "\x03\x1b\x4f\x46";
|
return "\x06\x1b\x5b\x31\x3b\x36\x46";
|
||||||
case 69: // F1
|
case 69: // F1
|
||||||
return "\x03\x1b\x4f\x50";
|
return "\x03\x1b\x4f\x50";
|
||||||
case 70: // F2
|
case 70: // F2
|
||||||
|
|||||||
@@ -54,6 +54,17 @@ SHIFTED_KEYS = {
|
|||||||
control_alt_codes = {
|
control_alt_codes = {
|
||||||
defines.GLFW_KEY_SPACE: b'\x1b\0',
|
defines.GLFW_KEY_SPACE: b'\x1b\0',
|
||||||
}
|
}
|
||||||
|
ASCII_C0_SHIFTED = {
|
||||||
|
# ^@
|
||||||
|
'2': b'\x00',
|
||||||
|
# ^^
|
||||||
|
'6': b'\x1e',
|
||||||
|
# ^_
|
||||||
|
'MINUS': b'\x1f',
|
||||||
|
# ^?
|
||||||
|
'SLASH': b'\x7f',
|
||||||
|
}
|
||||||
|
control_shift_keys = {getattr(defines, 'GLFW_KEY_' + k): v for k, v in ASCII_C0_SHIFTED.items()}
|
||||||
|
|
||||||
for kf, kn in {
|
for kf, kn in {
|
||||||
defines.GLFW_KEY_UP: 'kcuu1',
|
defines.GLFW_KEY_UP: 'kcuu1',
|
||||||
@@ -71,6 +82,7 @@ for kf, kn in {
|
|||||||
alt_codes[kf] = modify_complex_key(kn, 3)
|
alt_codes[kf] = modify_complex_key(kn, 3)
|
||||||
shift_alt_codes[kf] = modify_complex_key(kn, 4)
|
shift_alt_codes[kf] = modify_complex_key(kn, 4)
|
||||||
control_codes[kf] = modify_complex_key(kn, 5)
|
control_codes[kf] = modify_complex_key(kn, 5)
|
||||||
|
control_shift_keys[kf] = modify_complex_key(kn, 6)
|
||||||
control_alt_codes[kf] = modify_complex_key(kn, 7)
|
control_alt_codes[kf] = modify_complex_key(kn, 7)
|
||||||
for f in range(1, 13):
|
for f in range(1, 13):
|
||||||
kf = getattr(defines, 'GLFW_KEY_F{}'.format(f))
|
kf = getattr(defines, 'GLFW_KEY_F{}'.format(f))
|
||||||
@@ -215,17 +227,6 @@ SHIFTED_PRINTABLE.update(pmap(
|
|||||||
"{|}~"
|
"{|}~"
|
||||||
))
|
))
|
||||||
|
|
||||||
ASCII_C0_SHIFTED = {
|
|
||||||
# ^@
|
|
||||||
'2': b'\x00',
|
|
||||||
# ^^
|
|
||||||
'6': b'\x1e',
|
|
||||||
# ^_
|
|
||||||
'MINUS': b'\x1f',
|
|
||||||
# ^?
|
|
||||||
'SLASH': b'\x7f',
|
|
||||||
}
|
|
||||||
CTRL_SHIFT_KEYS = {getattr(defines, 'GLFW_KEY_' + k): v for k, v in ASCII_C0_SHIFTED.items()}
|
|
||||||
CTRL_ALT_KEYS = {getattr(defines, 'GLFW_KEY_' + k) for k in string.ascii_uppercase}
|
CTRL_ALT_KEYS = {getattr(defines, 'GLFW_KEY_' + k) for k in string.ascii_uppercase}
|
||||||
all_control_alt_keys = set(CTRL_ALT_KEYS) | set(control_alt_codes)
|
all_control_alt_keys = set(CTRL_ALT_KEYS) | set(control_alt_codes)
|
||||||
|
|
||||||
@@ -237,8 +238,8 @@ def key_to_bytes(key, smkx, extended, mods, action):
|
|||||||
if mods == defines.GLFW_MOD_CONTROL and key in control_codes:
|
if mods == defines.GLFW_MOD_CONTROL and key in control_codes:
|
||||||
# Map Ctrl-key to ascii control code
|
# Map Ctrl-key to ascii control code
|
||||||
data.extend(control_codes[key])
|
data.extend(control_codes[key])
|
||||||
elif mods == ctrl_shift_mod and key in CTRL_SHIFT_KEYS:
|
elif mods == ctrl_shift_mod and key in control_shift_keys:
|
||||||
data.extend(CTRL_SHIFT_KEYS[key])
|
data.extend(control_shift_keys[key])
|
||||||
elif mods in alt_mods:
|
elif mods in alt_mods:
|
||||||
if key in alt_codes:
|
if key in alt_codes:
|
||||||
data.extend((alt_codes if mods == defines.GLFW_MOD_ALT else shift_alt_codes)[key])
|
data.extend((alt_codes if mods == defines.GLFW_MOD_ALT else shift_alt_codes)[key])
|
||||||
|
|||||||
Reference in New Issue
Block a user