source:
trunk/config.tests/x11/xkb/xkb.cpp@
14
Last change on this file since 14 was 2, checked in by , 16 years ago | |
---|---|
File size: 888 bytes |
Line | |
---|---|
1 | #include <X11/Xlib.h> |
2 | #include <X11/XKBlib.h> |
3 | |
4 | int main(int, char **) |
5 | { |
6 | Display *display = 0; |
7 | |
8 | int opcode = -1; |
9 | int xkbEventBase = -1; |
10 | int xkbErrorBase = -1; |
11 | int xkblibMajor = XkbMajorVersion; |
12 | int xkblibMinor = XkbMinorVersion; |
13 | XkbQueryExtension(display, &opcode, &xkbEventBase, &xkbErrorBase, &xkblibMajor, &xkblibMinor); |
14 | |
15 | int keycode = 0; |
16 | unsigned int state = 0; |
17 | KeySym keySym; |
18 | unsigned int consumedModifiers; |
19 | XkbLookupKeySym(display, keycode, state, &consumedModifiers, &keySym); |
20 | |
21 | XkbDescPtr xkbDesc = XkbGetMap(display, XkbAllClientInfoMask, XkbUseCoreKbd); |
22 | int w = XkbKeyGroupsWidth(xkbDesc, keycode); |
23 | keySym = XkbKeySym(xkbDesc, keycode, w-1); |
24 | XkbFreeClientMap(xkbDesc, XkbAllClientInfoMask, true); |
25 | |
26 | state = XkbPCF_GrabsUseXKBStateMask; |
27 | (void) XkbSetPerClientControls(display, state, &state); |
28 | |
29 | return 0; |
30 | } |
Note:
See TracBrowser
for help on using the repository browser.