Fix shift+up/down not generating correct escape codes

Fixes #186
This commit is contained in:
Kovid Goyal 2017-11-26 17:34:34 +05:30
parent 65b212fa1b
commit e86c2f2000
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
6 changed files with 14 additions and 11 deletions

16
kitty/keys.h generated
View File

@ -569,9 +569,9 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 57: // LEFT case 57: // LEFT
return "\x06\x1b\x5b\x31\x3b\x32\x44"; return "\x06\x1b\x5b\x31\x3b\x32\x44";
case 58: // DOWN case 58: // DOWN
return "\x03\x1b\x5b\x42"; return "\x06\x1b\x5b\x31\x3b\x32\x42";
case 59: // UP case 59: // UP
return "\x03\x1b\x5b\x41"; return "\x06\x1b\x5b\x31\x3b\x32\x41";
case 60: // PAGE_UP case 60: // PAGE_UP
return "\x04\x1b\x5b\x35\x7e"; return "\x04\x1b\x5b\x35\x7e";
case 61: // PAGE_DOWN case 61: // PAGE_DOWN
@ -1767,9 +1767,9 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 57: // LEFT case 57: // LEFT
return "\x06\x1b\x5b\x31\x3b\x32\x44"; return "\x06\x1b\x5b\x31\x3b\x32\x44";
case 58: // DOWN case 58: // DOWN
return "\x03\x1b\x5b\x42"; return "\x06\x1b\x5b\x31\x3b\x32\x42";
case 59: // UP case 59: // UP
return "\x03\x1b\x5b\x41"; return "\x06\x1b\x5b\x31\x3b\x32\x41";
case 60: // PAGE_UP case 60: // PAGE_UP
return "\x04\x1b\x5b\x35\x7e"; return "\x04\x1b\x5b\x35\x7e";
case 61: // PAGE_DOWN case 61: // PAGE_DOWN
@ -2973,9 +2973,9 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 57: // LEFT case 57: // LEFT
return "\x06\x1b\x5b\x31\x3b\x32\x44"; return "\x06\x1b\x5b\x31\x3b\x32\x44";
case 58: // DOWN case 58: // DOWN
return "\x03\x1b\x4f\x42"; return "\x06\x1b\x5b\x31\x3b\x32\x42";
case 59: // UP case 59: // UP
return "\x03\x1b\x4f\x41"; return "\x06\x1b\x5b\x31\x3b\x32\x41";
case 60: // PAGE_UP case 60: // PAGE_UP
return "\x04\x1b\x5b\x35\x7e"; return "\x04\x1b\x5b\x35\x7e";
case 61: // PAGE_DOWN case 61: // PAGE_DOWN
@ -4171,9 +4171,9 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 57: // LEFT case 57: // LEFT
return "\x06\x1b\x5b\x31\x3b\x32\x44"; return "\x06\x1b\x5b\x31\x3b\x32\x44";
case 58: // DOWN case 58: // DOWN
return "\x03\x1b\x4f\x42"; return "\x06\x1b\x5b\x31\x3b\x32\x42";
case 59: // UP case 59: // UP
return "\x03\x1b\x4f\x41"; return "\x06\x1b\x5b\x31\x3b\x32\x41";
case 60: // PAGE_UP case 60: // PAGE_UP
return "\x04\x1b\x5b\x35\x7e"; return "\x04\x1b\x5b\x35\x7e";
case 61: // PAGE_DOWN case 61: // PAGE_DOWN

View File

@ -79,6 +79,8 @@ SHIFTED_KEYS = {
defines.GLFW_KEY_END: key_as_bytes('kEND'), defines.GLFW_KEY_END: key_as_bytes('kEND'),
defines.GLFW_KEY_LEFT: key_as_bytes('kLFT'), defines.GLFW_KEY_LEFT: key_as_bytes('kLFT'),
defines.GLFW_KEY_RIGHT: key_as_bytes('kRIT'), 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({ control_codes.update({

View File

@ -190,6 +190,8 @@ string_capabilities = {
'kpp': r'\E[5~', 'kpp': r'\E[5~',
# Scroll backwards (reverse index) # Scroll backwards (reverse index)
'kri': r'\E[1;2A', 'kri': r'\E[1;2A',
# scroll forwards (index)
'kind': r'\E[1;2B',
# Restore cursor # Restore cursor
'rc': r'\E8', 'rc': r'\E8',
# Reverse video # Reverse video
@ -276,8 +278,6 @@ string_capabilities = {
# 'is2': r'\E[!p\E[?3;4l\E[4l\E>', # 'is2': r'\E[!p\E[?3;4l\E[4l\E>',
# # Enter/send key # # Enter/send key
# 'kent': r'\EOM', # 'kent': r'\EOM',
# # scroll forwards
# 'kind': r'\E[1;2B',
# # reset2 # # reset2
# 'rs2': r'\E[!p\E[?3;4l\E[4l\E>', # 'rs2': r'\E[!p\E[?3;4l\E[4l\E>',
} }
@ -350,6 +350,7 @@ termcap_aliases.update({
'kN': 'knp', 'kN': 'knp',
'kP': 'kpp', 'kP': 'kpp',
'kR': 'kri', 'kR': 'kri',
'kF': 'kind',
'rc': 'rc', 'rc': 'rc',
'mr': 'rev', 'mr': 'rev',
'sr': 'ri', 'sr': 'ri',
@ -400,7 +401,6 @@ termcap_aliases.update({
# 'mk': 'invis', # 'mk': 'invis',
# 'is': 'is2', # 'is': 'is2',
# '@8': 'kent', # '@8': 'kent',
# 'kF': 'kind',
# 'r2': 'rs2', # 'r2': 'rs2',
}) })

Binary file not shown.

View File

@ -85,6 +85,7 @@ xterm-kitty|KovIdTTY,
khlp=, khlp=,
khome=\EOH, khome=\EOH,
kich1=\E[2~, kich1=\E[2~,
kind=\E[1;2B,
kmous=\E[M, kmous=\E[M,
knp=\E[6~, knp=\E[6~,
kpp=\E[5~, kpp=\E[5~,

Binary file not shown.