summaryrefslogtreecommitdiffstats
path: root/config.tests/x11/xkb/xkb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config.tests/x11/xkb/xkb.cpp')
-rw-r--r--config.tests/x11/xkb/xkb.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/config.tests/x11/xkb/xkb.cpp b/config.tests/x11/xkb/xkb.cpp
new file mode 100644
index 0000000..afe3c57
--- /dev/null
+++ b/config.tests/x11/xkb/xkb.cpp
@@ -0,0 +1,30 @@
+#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
+
+int main(int, char **)
+{
+ Display *display = 0;
+
+ int opcode = -1;
+ int xkbEventBase = -1;
+ int xkbErrorBase = -1;
+ int xkblibMajor = XkbMajorVersion;
+ int xkblibMinor = XkbMinorVersion;
+ XkbQueryExtension(display, &opcode, &xkbEventBase, &xkbErrorBase, &xkblibMajor, &xkblibMinor);
+
+ int keycode = 0;
+ unsigned int state = 0;
+ KeySym keySym;
+ unsigned int consumedModifiers;
+ XkbLookupKeySym(display, keycode, state, &consumedModifiers, &keySym);
+
+ XkbDescPtr xkbDesc = XkbGetMap(display, XkbAllClientInfoMask, XkbUseCoreKbd);
+ int w = XkbKeyGroupsWidth(xkbDesc, keycode);
+ keySym = XkbKeySym(xkbDesc, keycode, w-1);
+ XkbFreeClientMap(xkbDesc, XkbAllClientInfoMask, true);
+
+ state = XkbPCF_GrabsUseXKBStateMask;
+ (void) XkbSetPerClientControls(display, state, &state);
+
+ return 0;
+}