After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685944 - GdkEventKey should tell me which device created it
GdkEventKey should tell me which device created it
Product: gtk+
Classification: Platform
Component: Backend: X11
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks: 355474
Reported: 2012-10-11 09:42 UTC by Bastien Nocera
Modified: 2012-10-11 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Bastien Nocera 2012-10-11 09:42:55 UTC
Currently, only mouse/pointer events structs have a device member (GdkEventButton, GdkEventTouch, GdkEventScroll, GdkEventMotion and GdkEventProximity).

It would make sense for applications to be able to behave differently based on the device used (eg. the device could be tagged as a remote and long presses would be different than if the same keycode was hit on a keyboard).
Comment 1 Emmanuele Bassi (:ebassi) 2012-10-11 10:24:38 UTC
you should use gdk_event_get_device(), not the direct struct access.

the GdkDevice is stored in the event private data, and copied into the structure field only for those events that have one.