From ad21c7ed0fc86028fe6e20e5bbffdfa26b23bb0c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 May 2017 21:09:20 +0530 Subject: [PATCH] Mimic behavior of xterm when pressing Ctrl+ Where is one of ,.;'-= These dont map to control codes, xterm and libvte just ignore the Ctrl and echo the key as if control was not pressed. Mimic that behavior --- kitty/keys.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kitty/keys.py b/kitty/keys.py index 721510c8a..2b7c2dc8d 100644 --- a/kitty/keys.py +++ b/kitty/keys.py @@ -51,6 +51,17 @@ for f in range(1, 13): 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) +f = {k: k for k in '0123456789'} +f.update({ + 'COMMA': ',', + 'PERIOD': '.', + 'SEMICOLON': ';', + 'APOSTROPHE': "'", + 'MINUS': '-', + 'EQUAL': '=', +}) +for kf, kn in f.items(): + control_codes[getattr(defines, 'GLFW_KEY_' + kf)] = (ord(kn),) del f, kf, kn smkx_key_map[defines.GLFW_KEY_ESCAPE] = b'\033'