]> Sergey Matveev's repositories - st.git/commitdiff
Add 14th bit to XK_SWITCH_MOD bitmask
authorPetar Kapriš <petarkapris@firemail.cc>
Sat, 17 Jul 2021 22:14:00 +0000 (00:14 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 18 Jul 2021 09:44:56 +0000 (11:44 +0200)
The bits of uint signal in an XKeyEvent which concern the key group (keyboard
layout) are bits 13 and 14, as documented here:
https://www.x.org/releases/X11R7.7/doc/libX11/XKB/xkblib.html#Groups_and_Shift_Levels
In the older version, only bit 13 was marked as part of XK_SWITCH_MOD, this
causes issues for users who have more than two keymaps. the 14th bit is not
in ignoremod, key sequences are not caught by match(), if they switch to a third
or fourth keyboard.

x.c

diff --git a/x.c b/x.c
index 718604067917b7b470a1618cedc72da379ebee37..248d5050111d0b3bae2785e90480502807139197 100644 (file)
--- a/x.c
+++ b/x.c
@@ -48,7 +48,7 @@ typedef struct {
 /* X modifiers */
 #define XK_ANY_MOD    UINT_MAX
 #define XK_NO_MOD     0
-#define XK_SWITCH_MOD (1<<13)
+#define XK_SWITCH_MOD (1<<13|1<<14)
 
 /* function definitions used in config.h */
 static void clipcopy(const Arg *);