From ff5b67e5e0951230d2ea4c1ac9c9f7179f975b86 Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Sun, 30 Jan 2022 16:29:05 -0800 Subject: [PATCH] IBus should use ev keycode instead of X keycode See: https://github.com/ibus/ibus/blob/5a455b1ead5d72483952356ddfe25b9e3b637e6f/client/gtk2/ibusimcontext.c#L468 --- src/core/linux/SDL_ibus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index a7bafda35..20236e713 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -510,8 +510,9 @@ SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode) if (IBus_CheckConnection(dbus)) { Uint32 mods = IBus_ModState(); + Uint32 ibus_keycode = keycode - 8; if (!SDL_DBus_CallMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "ProcessKeyEvent", - DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mods, DBUS_TYPE_INVALID, + DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &ibus_keycode, DBUS_TYPE_UINT32, &mods, DBUS_TYPE_INVALID, DBUS_TYPE_BOOLEAN, &result, DBUS_TYPE_INVALID)) { result = 0; }