[PATCH evdev 1/7] modifying evdev.h to be ready for multitouch : adding a struct to store the mt events
Benjamin Tissoires
tissoire at cena.fr
Sat Dec 19 01:27:27 PST 2009
Signed-off-by: Benjamin Tissoires <tissoire at cena.fr>
---
src/evdev.h | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/src/evdev.h b/src/evdev.h
index 95d00db..54cd74b 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -65,6 +65,11 @@
#define MAX_VALUATORS 36
#endif
+/* MT related */
+#define MAX_VALUATORS_MT 5 //currently if MAXDEVICES == 40
+#define DEFAULT_MT_TIMEOUT 100
+#define EVDEV_PROP_TRACKING_ID "Evdev Tracking ID"
+#define EVDEV_PROP_MULTITOUCH_SUBDEVICES "Evdev MultiTouch"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
typedef struct {
@@ -89,6 +94,15 @@ typedef struct {
int traveled_distance;
} WheelAxis, *WheelAxisPtr;
+/* struct used to store MT events until the EV_SYNC. */
+typedef struct _EvdevDataMTRec{
+ int id;
+ BOOL containsValues;
+ Time expires;
+ int vals[MAX_VALUATORS];
+ InputInfoPtr pInfo;
+} EvdevDataMTRec, *EvdevDataMTPtr;
+
/* Event queue used to defer keyboard/button events until EV_SYN time. */
typedef struct {
enum {
@@ -178,6 +192,29 @@ typedef struct {
/* Event queue used to defer keyboard/button events until EV_SYN time. */
int num_queue;
EventQueueRec queue[EVDEV_MAXQUEUE];
+
+ /* mt related */
+ /* used to store MT events until the EV_SYNC. */
+ EvdevDataMTRec vals_mt[MAX_VALUATORS_MT];
+ /* flag that tells whether mt was send during the sequence. */
+ unsigned int mt;
+ /* the number of subdevice we have for mt. */
+ unsigned int num_multitouch;
+ /* the maximum time between two events to consider a mt event as released. */
+ Time timeout;
+
+ OsTimerPtr subdevice_timer;
+
+ /* to store the trackID. */
+ int current_id;
+
+ /* as the N-Trig does not track the touches, we need to reconstruct a trckingID. */
+ int id;
+ int num_mt;
+
+ /* the reference of the main mt device. */
+ InputInfoPtr core_device;
+
} EvdevRec, *EvdevPtr;
/* Event posting functions */
--
1.6.5.2
--------------090208080606020807080800
Content-Type: text/x-patch;
name="0002-detection-of-multitouch-devices-and-adding-the-Evdev.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename*0="0002-detection-of-multitouch-devices-and-adding-the-Evdev.pa";
filename*1="tch"
More information about the xorg-devel
mailing list