From 333300b297213788ed9eaec83a0f8b314dee3d4c Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sun, 16 Aug 2026 20:22:17 +0900 Subject: [PATCH] ipc: fold Shift+Tab and the keypad Enter and Tab onto Tab and Enter Shift+Tab arrives from every frontend as ISO_Left_Tab (0xfe20), which has no Unicode value and lies outside the function keysym range, so ipckeysym gave key 0 and the documented Shift-Tab wrap through search results never reached the engine; GTK moved focus instead. KP_Enter and KP_Tab likewise became unknown special keys, so the keypad Enter committed the reading and passed a newline instead of taking the highlighted candidate. --- ipc.c | 8 ++++++++ tests/ipc_test.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ipc.c b/ipc.c index 5011571..9071b56 100644 --- a/ipc.c +++ b/ipc.c @@ -166,12 +166,20 @@ ipcconnect(void) /* * Engine key for an X keysym and its Unicode value: printable characters * as themselves, the function keysyms 0xff00-0xffff as Kspec+offset. + * The keypad and Shift+Tab (ISO_Left_Tab) variants fold onto Enter and Tab. */ uint32_t ipckeysym(uint32_t sym, uint32_t unicode) { if(unicode >= ' ' && unicode != 0x7f) return unicode; + switch(sym){ + case 0xfe20: + case 0xff89: + return Ktab; + case 0xff8d: + return Kret; + } if(sym >= 0xff00 && sym <= 0xffff) return Kspec + (sym - 0xff00); return unicode; diff --git a/tests/ipc_test.c b/tests/ipc_test.c index a10673f..964339c 100644 --- a/tests/ipc_test.c +++ b/tests/ipc_test.c @@ -53,6 +53,8 @@ ipc_masks_modifiers(struct ct *t) CT_EQ_UINT(t, 'a', ipckeysym('a', 'a')); CT_EQ_UINT(t, '1', ipckeysym(0xffb1, '1')); /* KP_1 */ CT_EQ_UINT(t, Kret, ipckeysym(0xff0d, '\r')); + CT_EQ_UINT(t, Kret, ipckeysym(0xff8d, '\r')); /* KP_Enter */ + CT_EQ_UINT(t, Ktab, ipckeysym(0xfe20, 0)); /* ISO_Left_Tab */ CT_EQ_UINT(t, Kback, ipckeysym(0xff08, 8)); CT_EQ_UINT(t, Kspec + 0xff, ipckeysym(0xffff, 0x7f)); /* Delete */ CT_EQ_UINT(t, 0x1f642, ipckeysym(0x101f642, 0x1f642));