Commit c1efd260 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(Fx_backspace_delete_keys_p): Use XkbGetMap and

XkbGetNames instead of XkbGetKeyboard.
parent 1bfb1345
2001-01-10 Gerd Moellmann <gerd@gnu.org>
* xfns.c (Fx_backspace_delete_keys_p): Use XkbGetMap and
XkbGetNames instead of XkbGetKeyboard.
2001-01-10 Dave Love <fx@gnu.org>
* sysdep.c (random): Revert the declaration.
......
......@@ -11179,34 +11179,45 @@ usual X keysyms.")
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment