Fetching symbols information with XKBlib
Dmitry Antipov <[email protected]>
| Newsgroups | gmane.comp.xfree86.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
my X server is XKB-enabled, and keyboard is configured to suport Russian
input:
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc104"
Option "XkbLayout" "ru(phonetic)"
Option "XkbSymbols" "en_US(pc104)+ru(phonetic)+group(shift_toggle)"
Option "XkbOptions" "grp:shift_toggle"
EndSection
With this configuration, Shift-Shift toggles from English to Russian, and my app
needs to know which symbols are current. I'm trying to use XKBlib calls to
obtain the state:
...
XkbEvent xkbev;
...
display = XkbOpenDisplay(...);
XkbSelectEvents (display, XkbUseCoreKbd,
XkbStateNotifyMask, XkbStateNotifyMask);
...
while (1) {
XNextEvent (display, &xkbev.core);
if (xkbev.state.changed == (XkbGroupStateMask |
XkbGroupLockMask |
XkbCompatStateMask |
XkbCompatLookupModsMask)) {
/* Symbols switched, need to ask about current ones */
}
}
But I can't find a way to ask about current symbols. I just want to receive
short description like 'ru' or 'en' (or any other information which may be
used to identify current symbols) - is there a way to get it ?
Thanks,
Dmitry