wayland: Fix up key event translation

The is_modifier field is supposed to be set if the key
would act as a modifier, not if any modifiers are currently
active. To fix this, introduce a private
_gdk_wayland_keymap_key_is_modifier function.

At the same time, make the hardware_keycode field in key
events actually contain the hardware keycode, not a copy
of the keyval.
This commit is contained in:
Matthias Clasen
2013-04-06 10:40:56 -04:00
parent c659f892ff
commit eb9ab7aad4
3 changed files with 24 additions and 3 deletions

View File

@ -1032,10 +1032,9 @@ deliver_key_event(GdkWaylandDeviceData *device,
event->button.time = time;
event->key.state = device->modifiers;
event->key.group = 0;
event->key.hardware_keycode = sym;
event->key.hardware_keycode = key;
event->key.keyval = sym;
event->key.is_modifier = device->modifiers > 0;
event->key.is_modifier = _gdk_wayland_keymap_key_is_modifier (keymap, key);
translate_keyboard_string (&event->key);