Add in the redundant ctrl+<234578`> key combinations in normal and application mode. They all conflict with other keys but by implementing them the same as other terminals, I can at least avoid having to explain how they Ctrl+number is broken in traditional terminals over and over again.

This commit is contained in:
Kovid Goyal 2018-05-28 20:37:48 +05:30
parent daafea7f7e
commit 7332561d8e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 41 additions and 26 deletions

56
kitty/keys.h generated
View File

@ -677,19 +677,19 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 7: // 1
return "\x01\x31";
case 8: // 2
return "\x01\x32";
return "\x01\x00";
case 9: // 3
return "\x01\x33";
return "\x01\x1b";
case 10: // 4
return "\x01\x34";
return "\x01\x1c";
case 11: // 5
return "\x01\x35";
return "\x01\x1d";
case 12: // 6
return "\x01\x1e";
case 13: // 7
return "\x01\x37";
return "\x01\x1f";
case 14: // 8
return "\x01\x38";
return "\x01\x7f";
case 15: // 9
return "\x01\x39";
case 16: // SEMICOLON
@ -754,6 +754,8 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
return "\x01\x1c";
case 46: // RIGHT_BRACKET
return "\x01\x1d";
case 47: // GRAVE_ACCENT
return "\x01\x00";
case 50: // ESCAPE
return "\x01\x1b";
case 51: // ENTER
@ -2302,19 +2304,19 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 7: // 1
return "\x01\x31";
case 8: // 2
return "\x01\x32";
return "\x01\x00";
case 9: // 3
return "\x01\x33";
return "\x01\x1b";
case 10: // 4
return "\x01\x34";
return "\x01\x1c";
case 11: // 5
return "\x01\x35";
return "\x01\x1d";
case 12: // 6
return "\x01\x1e";
case 13: // 7
return "\x01\x37";
return "\x01\x1f";
case 14: // 8
return "\x01\x38";
return "\x01\x7f";
case 15: // 9
return "\x01\x39";
case 16: // SEMICOLON
@ -2379,6 +2381,8 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
return "\x01\x1c";
case 46: // RIGHT_BRACKET
return "\x01\x1d";
case 47: // GRAVE_ACCENT
return "\x01\x00";
case 50: // ESCAPE
return "\x01\x1b";
case 51: // ENTER
@ -3936,19 +3940,19 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 7: // 1
return "\x01\x31";
case 8: // 2
return "\x01\x32";
return "\x01\x00";
case 9: // 3
return "\x01\x33";
return "\x01\x1b";
case 10: // 4
return "\x01\x34";
return "\x01\x1c";
case 11: // 5
return "\x01\x35";
return "\x01\x1d";
case 12: // 6
return "\x01\x1e";
case 13: // 7
return "\x01\x37";
return "\x01\x1f";
case 14: // 8
return "\x01\x38";
return "\x01\x7f";
case 15: // 9
return "\x01\x39";
case 16: // SEMICOLON
@ -4013,6 +4017,8 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
return "\x01\x1c";
case 46: // RIGHT_BRACKET
return "\x01\x1d";
case 47: // GRAVE_ACCENT
return "\x01\x00";
case 50: // ESCAPE
return "\x01\x1b";
case 51: // ENTER
@ -5561,19 +5567,19 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
case 7: // 1
return "\x01\x31";
case 8: // 2
return "\x01\x32";
return "\x01\x00";
case 9: // 3
return "\x01\x33";
return "\x01\x1b";
case 10: // 4
return "\x01\x34";
return "\x01\x1c";
case 11: // 5
return "\x01\x35";
return "\x01\x1d";
case 12: // 6
return "\x01\x1e";
case 13: // 7
return "\x01\x37";
return "\x01\x1f";
case 14: // 8
return "\x01\x38";
return "\x01\x7f";
case 15: // 9
return "\x01\x39";
case 16: // SEMICOLON
@ -5638,6 +5644,8 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) {
return "\x01\x1c";
case 46: // RIGHT_BRACKET
return "\x01\x1d";
case 47: // GRAVE_ACCENT
return "\x01\x00";
case 50: // ESCAPE
return "\x01\x1b";
case 51: // ENTER

View File

@ -107,9 +107,16 @@ control_codes.update({
for i, k in
enumerate(range(defines.GLFW_KEY_A, defines.GLFW_KEY_RIGHT_BRACKET + 1))
})
control_codes[defines.GLFW_KEY_6] = (30,)
control_codes[defines.GLFW_KEY_SLASH] = (31,)
control_codes[defines.GLFW_KEY_GRAVE_ACCENT] = (0,)
control_codes[defines.GLFW_KEY_SPACE] = (0,)
control_codes[defines.GLFW_KEY_2] = (0,)
control_codes[defines.GLFW_KEY_3] = (27,)
control_codes[defines.GLFW_KEY_4] = (28,)
control_codes[defines.GLFW_KEY_5] = (29,)
control_codes[defines.GLFW_KEY_6] = (30,)
control_codes[defines.GLFW_KEY_7] = (31,)
control_codes[defines.GLFW_KEY_SLASH] = (31,)
control_codes[defines.GLFW_KEY_8] = (127,)
rmkx_key_map = smkx_key_map.copy()
rmkx_key_map.update({