mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
clutter/x11: Consider remapped keys when guessing the keycode from the keysym
Since e3e933c4
a keyval can be temporarily remapped to an unused keycode. Due to
some limitations in XTestFakeKeyEvent, the remapping has to be done in the first
xkb group/layout. In case there are two or more keyboard layouts enabled and the
selected keyboard layout is not the first, clutter_keymap_x11_keycode_for_keyval
will fail to retrieve the correct keycode for a remapped keyval. Let's use the
reserved_keycodes map in order to retrieve the correct keycode if needed.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/443
This commit is contained in:
parent
d597449a0e
commit
e0811ce141
@ -955,6 +955,26 @@ clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11,
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_hash_table_iter_init (&iter, keymap_x11->reserved_keycodes);
|
||||
while (!found && g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
guint reserved_keycode = GPOINTER_TO_UINT (key);
|
||||
guint reserved_keysym = GPOINTER_TO_UINT (value);
|
||||
|
||||
if (keyval == reserved_keysym)
|
||||
{
|
||||
*keycode_out = reserved_keycode;
|
||||
*level_out = 0;
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_free (keys);
|
||||
return found;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user