From 8aeea7fb7351ff6c9e6edf42b529803ac1699a90 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 17 Nov 2015 17:44:19 +0100 Subject: [PATCH] evdev: Set event code on button/key events This will allow users to know the event code without strange calculations on event->key.hardware_keycode or event->button.button. https://bugzilla.gnome.org/show_bug.cgi?id=758238 --- clutter/evdev/clutter-device-manager-evdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c index ccc923e29..37bb50740 100644 --- a/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/evdev/clutter-device-manager-evdev.c @@ -312,6 +312,7 @@ notify_key_device (ClutterInputDevice *input_device, seat->xkb, seat->button_state, time_, key, state); + _clutter_evdev_event_set_event_code (event, key); /* We must be careful and not pass multiple releases to xkb, otherwise it gets confused and locks the modifiers */ @@ -652,6 +653,8 @@ notify_button (ClutterInputDevice *input_device, clutter_event_set_device (event, seat->core_pointer); clutter_event_set_source_device (event, input_device); + _clutter_evdev_event_set_event_code (event, button); + _clutter_input_device_set_stage (seat->core_pointer, stage); queue_event (event);