mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-07 04:10:27 -08:00
(Fx_backspace_delete_keys_p): Use XkbGetMap and
XkbGetNames instead of XkbGetKeyboard.
This commit is contained in:
parent
1bfb134516
commit
c1efd26046
2 changed files with 31 additions and 15 deletions
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
|
|||
41
src/xfns.c
41
src/xfns.c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue