major = XkbMajorVersion;
minor = XkbMinorVersion;
if (!XkbLibraryVersion (&major, &minor))
- return Qnil;
+ {
+ UNBLOCK_INPUT;
+ return Qnil;
+ }
/* Check that the server supports XKB. */
major = XkbMajorVersion;
minor = XkbMinorVersion;
if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor))
- return Qnil;
+ {
+ UNBLOCK_INPUT;
+ return Qnil;
+ }
have_keys = Qnil;
- kb = XkbGetKeyboard (dpy, XkbAllComponentsMask, XkbUseCoreKbd);
+ kb = XkbGetMap (dpy, XkbAllMapComponentsMask, XkbUseCoreKbd);
if (kb)
{
int delete_keycode = 0, backspace_keycode = 0, i;
-
- for (i = kb->min_key_code;
- (i < kb->max_key_code
- && (delete_keycode == 0 || backspace_keycode == 0));
- ++i)
+
+ if (XkbGetNames (dpy, XkbAllNamesMask, kb) == Success)
{
- /* The XKB symbolic key names can be seen most easily
- in the PS file generated by `xkbprint -label name $DISPLAY'. */
- if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
- delete_keycode = i;
- else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
- backspace_keycode = i;
+ for (i = kb->min_key_code;
+ (i < kb->max_key_code
+ && (delete_keycode == 0 || backspace_keycode == 0));
+ ++i)
+ {
+ /* The XKB symbolic key names can be seen most easily
+ in the PS file generated by `xkbprint -label name $DISPLAY'. */
+ if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
+ delete_keycode = i;
+ else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
+ backspace_keycode = i;
+ }
+
+ XkbFreeNames (kb, 0, True);
}
- XkbFreeKeyboard (kb, 0, True);
+ XkbFreeClientMap (kb, 0, True);
if (delete_keycode
&& backspace_keycode