summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2009-07-13 16:49:33 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-14 11:52:40 +1000
commit51244a1a4f7165d995c139ba1f0d03d8a1140015 (patch)
tree6379e5bd27d554bcbe1c39ac5bf3435f0c672b40
parentc455db2c251770a729d2747e6f05d53c2563b428 (diff)
Device{,Raw}Event: Add flags field.
Add a flags member to DeviceEvent and DeviceKeyEvent; the only currently defined flag is KeyRepeat, indicating a repeat event (a la XKB detectable autorepeat), which is only valid for key events. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--XI2.h5
-rw-r--r--XI2proto.h3
-rw-r--r--XI2proto.txt15
3 files changed, 22 insertions, 1 deletions
diff --git a/XI2.h b/XI2.h
index 2ed65f9..3af9f0f 100644
--- a/XI2.h
+++ b/XI2.h
@@ -108,6 +108,11 @@
#define XIButtonClass 1
#define XIValuatorClass 2
+/* Device event flags (common) */
+/* Device event flags (key events only) */
+#define XIKeyRepeat (1 << 16)
+/* Device event flags (pointer events only) */
+
/* XI2 event mask macros */
#define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7)))
#define XIClearMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &= ~(1 << ((event) & 7)))
diff --git a/XI2proto.h b/XI2proto.h
index b7b118b..e6ec190 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -936,6 +936,7 @@ typedef struct
uint16_t valuators_len; /**< Len of val. flags in 4 b units */
uint16_t sourceid; /**< The source device */
uint16_t pad0;
+ uint32_t flags; /**< ::XIKeyRepeat */
xXIModifierInfo mods;
xXIGroupInfo group;
} xXIDeviceEvent;
@@ -962,7 +963,7 @@ typedef struct
::XI_KeyRelease */
uint16_t valuators_len; /**< Length of trailing valuator
mask in 4 byte units */
- uint32_t pad1;
+ uint32_t flags; /**< ::XIKeyRepeat */
uint32_t pad2;
} xXIRawEvent;
diff --git a/XI2proto.txt b/XI2proto.txt
index 12926c5..2f25fb1 100644
--- a/XI2proto.txt
+++ b/XI2proto.txt
@@ -1390,6 +1390,7 @@ EVENTHEADER { type: BYTE
sourceid: DEVICEID
mods: MODIFIERINFO
group: GROUPINFO
+ flags: DEVICEEEVENTFLAGS
buttons: SETofBUTTONMASK
valuators: SETofVALUATORMASK
axisvalues: LISTofFP3232
@@ -1407,6 +1408,10 @@ EVENTHEADER { type: BYTE
locked_group: CARD8,
effective_group: CARD8}
+ DEVICEEVENTFLAGS (all events): none
+ DEVICEEVENTFLAGS (key events only): { KeyRepeat }
+ DEVICEEVENTFLAGS (pointer events only): none
+
An XIDeviceEvent is generated whenever the logical state of a device
changes in response to a button press, a button release, a motion, a key
press or a key release.
@@ -1442,6 +1447,13 @@ EVENTHEADER { type: BYTE
Bitmask of valuators provided in 'axisvalues'.
axisvalues
Valuator data in device-native resolution.
+ flags
+ Miscellaneous information about this event; the union of the
+ common flag set and either the key or pointer flag set,
+ depending on the event type.
+ KeyRepeat means that this event is for repeating purposes, and
+ the physical state of the key has not changed. This is only
+ valid for KeyPress events.
Modifier state in 'mods' is detailed as follows:
base_mods
@@ -1463,6 +1475,7 @@ EVENTHEADER { type: BYTE
RawEvent
EVENTHEADER
detail: CARD32
+ flags: DEVICEEVENTFLAGS
valuators_len: CARD16
valuators: SETofVALUATORMASK
axisvalues: LISTofFP3232
@@ -1482,6 +1495,8 @@ EVENTHEADER { type: BYTE
The type of event that occured on the device.
detail
The button number or keycode.
+ flags
+ Flags as described in DeviceEvent::flags.
valuators_len
The length of 'valuators' in 4 byte units.
valuators