Fix TAB not working and add entry for backtab to terminfo

This commit is contained in:
Kovid Goyal 2016-10-31 12:03:21 +05:30
parent fd6f96a4f7
commit 027a9751c1
3 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@ key_map = {
key_map = {k: b'\x1b' + v for k, v in key_map.items()}
key_map[glfw.GLFW_KEY_ENTER] = b'\n\r'
key_map[glfw.GLFW_KEY_BACKSPACE] = b'\x08'
key_map[glfw.GLFW_KEY_TAB] = b'\t'
control_codes = {k: 1 + i for i, k in enumerate(range(glfw.GLFW_KEY_A, glfw.GLFW_KEY_RIGHT_BRACKET))}
alt_codes = {k: (0x1b, k) for i, k in enumerate(range(glfw.GLFW_KEY_A, glfw.GLFW_KEY_RIGHT_BRACKET))}
@ -48,6 +49,9 @@ def interpret_key_event(key, scancode, mods):
else:
x = key_map.get(key)
if x is not None:
if mods == glfw.GLFW_MOD_SHIFT:
if key == glfw.GLFW_KEY_TAB:
x = b'\x1b[Z'
data.extend(x)
return bytes(data)

View File

@ -17,6 +17,7 @@ xterm-kitty|KovIdTTY,
bel=^G,
bold=\E[1m,
cbt=\E[Z,
kcbt=\E[Z,
civis=\E[?25l,
clear=\E[H\E[2J,
cnorm=\E[?12l\E[?25h,

Binary file not shown.