aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-28 10:50:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-08 19:30:25 +0000
commite4f164d9585d4e84de15061de6430d5c1c1a12ed (patch)
treefc97d55f21e97d9e6aaf176e4bcd3ac7813ac466 /input.c
parentinput: do not include consumed modifiers in the set sent to the client (diff)
keymap: handle shift+tab combos correctly, after consuming modifiers
Shift+Tab is an odd bird in XKB; it produces a shifted variant of tab, ISO_Left_Tab, with Shift being a consumed modifier. From a terminal perspective, Tab and ISO_Left_Tab are the same key, with Shift+Tab generating ‘CSI Z’, and all other combos generating a ‘CSI 27;mods;9~’ escape. Before, when we didn’t filter out consumed modifiers, we could simply re-use the keymap for Tab when translating ISO_Left_Tab. This is no longer possible, since shift has been filtered out. As a result, Shift+Tab no longer generated ‘CSI Z’, but ‘\t’. I.e as if shift wasn’t being pressed. This patch adds a separate keymap table for ISO_Left_Tab. It’s MOD_ANY entry corresponds to Shift+Tab, and emits ‘CSI Z’. All its other entries *exclude* shift (since it has been consumed), *but*, the encoded modifier (in the escape sequences) *include* shift.
Diffstat (limited to 'input.c')
-rw-r--r--input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/input.c b/input.c
index 110bd378..bc28bbf2 100644
--- a/input.c
+++ b/input.c
@@ -770,8 +770,8 @@ keymap_data_for_sym(xkb_keysym_t sym, size_t *count)
switch (sym) {
case XKB_KEY_Escape: *count = ALEN(key_escape); return key_escape;
case XKB_KEY_Return: *count = ALEN(key_return); return key_return;
- case XKB_KEY_Tab: /* FALLTHROUGH */
- case XKB_KEY_ISO_Left_Tab: *count = ALEN(key_tab); return key_tab;
+ case XKB_KEY_ISO_Left_Tab: *count = ALEN(key_iso_left_tab); return key_iso_left_tab;
+ case XKB_KEY_Tab: *count = ALEN(key_tab); return key_tab;
case XKB_KEY_BackSpace: *count = ALEN(key_backspace); return key_backspace;
case XKB_KEY_Up: *count = ALEN(key_up); return key_up;
case XKB_KEY_Down: *count = ALEN(key_down); return key_down;