diff options
author | Daniel Stone <daniels@collabora.com> | 2015-11-20 15:37:29 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-11-24 11:36:32 +1000 |
commit | c3788394e9190130a8eed44c5c93eeb93c2a9893 (patch) | |
tree | 16680fcc42e5b61778b432be8c037270ab6b4777 /include | |
parent | 2e61901e46d28ce2f436219ad1a495aa0dcd0fba (diff) |
Input: Add DeviceEventSource enum
Add a flag to DeviceEvents, giving the source of the event. Currently
this only supports a 'normal' flag, but will be used later to add a
'focus-in' flag, noting events synthesised from key/button arrays on
focus-in notifications.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/eventstr.h | 9 | ||||
-rw-r--r-- | include/inpututils.h | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/eventstr.h b/include/eventstr.h index cce903d04..4fd846f10 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -25,6 +25,7 @@ #ifndef EVENTSTR_H #define EVENTSTR_H +#include "inputstr.h" #include <events.h> /** * @file events.h @@ -78,6 +79,13 @@ enum EventType { }; /** + * How a DeviceEvent was provoked + */ +enum DeviceEventSource { + EVENT_SOURCE_NORMAL = 0, /**< Default: from a user action (e.g. key press) */ +}; + +/** * Used for ALL input device events internal in the server until * copied into the matching protocol event. * @@ -124,6 +132,7 @@ struct _DeviceEvent { int key_repeat; /**< Internally-generated key repeat event */ uint32_t flags; /**< Flags to be copied into the generated event */ uint32_t resource; /**< Touch event resource, only for TOUCH_REPLAYING */ + enum DeviceEventSource source_type; /**< How this event was provoked */ }; /** diff --git a/include/inpututils.h b/include/inpututils.h index 4e9081563..48c95c4c1 100644 --- a/include/inpututils.h +++ b/include/inpututils.h @@ -30,6 +30,7 @@ #define INPUTUTILS_H #include "input.h" +#include "eventstr.h" #include <X11/extensions/XI2proto.h> extern Mask event_filters[MAXDEVICES][MAXEVENTS]; @@ -43,7 +44,8 @@ struct _ValuatorMask { }; extern void verify_internal_event(const InternalEvent *ev); -extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms); +extern void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms, + enum DeviceEventSource event_source); extern int event_get_corestate(DeviceIntPtr mouse, DeviceIntPtr kbd); extern void event_set_state(DeviceIntPtr mouse, DeviceIntPtr kbd, DeviceEvent *event); |