diff options
author | axis <qt-info@nokia.com> | 2009-04-24 11:34:15 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-04-24 11:34:15 (GMT) |
commit | 8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76 (patch) | |
tree | a17e1a767a89542ab59907462206d7dcf2e504b2 /config.tests/x11/xkb | |
download | Qt-8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76.zip Qt-8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76.tar.gz Qt-8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76.tar.bz2 |
Long live Qt for S60!
Diffstat (limited to 'config.tests/x11/xkb')
-rw-r--r-- | config.tests/x11/xkb/xkb.cpp | 30 | ||||
-rw-r--r-- | config.tests/x11/xkb/xkb.pro | 3 |
2 files changed, 33 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; +} diff --git a/config.tests/x11/xkb/xkb.pro b/config.tests/x11/xkb/xkb.pro new file mode 100644 index 0000000..d4ec222 --- /dev/null +++ b/config.tests/x11/xkb/xkb.pro @@ -0,0 +1,3 @@ +SOURCES = xkb.cpp +CONFIG += x11 +CONFIG -= qt |