diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-14 13:21:59 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-16 11:18:47 +1000 |
commit | 3390d3fc0347947796aa245d70fefecf59b7bfe4 (patch) | |
tree | cd75951a6b51b788018e75bd95ed81f1d7edd611 | |
parent | 84db813b9db34975b5fe288a8a551bb98f0cc1c1 (diff) |
Xi: process raw touch events
No-one can generated them yet, but if they could, we'd be processing them
like there was no tomorrow.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r-- | Xi/exevents.c | 3 | ||||
-rw-r--r-- | Xi/extinit.c | 3 | ||||
-rw-r--r-- | Xi/xiselectev.c | 5 | ||||
-rw-r--r-- | dix/eventconvert.c | 12 | ||||
-rw-r--r-- | dix/events.c | 3 | ||||
-rw-r--r-- | dix/getevents.c | 11 | ||||
-rw-r--r-- | include/eventstr.h | 3 | ||||
-rw-r--r-- | mi/mieq.c | 3 |
8 files changed, 41 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index b05cf2ce4..2db605302 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1063,6 +1063,9 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchUpdate: + case ET_RawTouchEnd: DeliverRawEvent(&ev->raw_event, device); break; default: diff --git a/Xi/extinit.c b/Xi/extinit.c index 87f793321..0b7bc3424 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -868,6 +868,9 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to) case XI_RawKeyRelease: case XI_RawButtonPress: case XI_RawButtonRelease: + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: SRawEvent((xXIRawEvent*)from, (xXIRawEvent*)to); break; default: diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index ee14edb6d..815a34fc7 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -145,7 +145,10 @@ ProcXISelectEvents(ClientPtr client) BitIsOn(bits, XI_RawKeyRelease) || BitIsOn(bits, XI_RawButtonPress) || BitIsOn(bits, XI_RawButtonRelease) || - BitIsOn(bits, XI_RawMotion)) + BitIsOn(bits, XI_RawMotion) || + BitIsOn(bits, XI_RawTouchBegin) || + BitIsOn(bits, XI_RawTouchUpdate) || + BitIsOn(bits, XI_RawTouchEnd)) { client->errorValue = XI_RawKeyPress; return BadValue; diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 3802ea142..582769ad8 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -158,6 +158,9 @@ EventToCore(InternalEvent *event, xEvent **core_out, int *count_out) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchUpdate: + case ET_RawTouchEnd: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: @@ -211,6 +214,9 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchUpdate: + case ET_RawTouchEnd: case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: @@ -270,6 +276,9 @@ EventToXI2(InternalEvent *ev, xEvent **xi) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchUpdate: + case ET_RawTouchEnd: return eventToRawEvent(&ev->raw_event, xi); default: break; @@ -827,6 +836,9 @@ GetXI2Type(enum EventType type) case ET_RawButtonPress: xi2type = XI_RawButtonPress; break; case ET_RawButtonRelease: xi2type = XI_RawButtonRelease; break; case ET_RawMotion: xi2type = XI_RawMotion; break; + case ET_RawTouchBegin: xi2type = XI_RawTouchBegin; break; + case ET_RawTouchUpdate: xi2type = XI_RawTouchUpdate; break; + case ET_RawTouchEnd: xi2type = XI_RawTouchEnd; break; case ET_FocusIn: xi2type = XI_FocusIn; break; case ET_FocusOut: xi2type = XI_FocusOut; break; case ET_TouchBegin: xi2type = XI_TouchBegin; break; diff --git a/dix/events.c b/dix/events.c index 2b54969d8..f80b8fddf 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2463,6 +2463,9 @@ FixUpEventFromWindow( case XI_RawButtonPress: case XI_RawButtonRelease: case XI_RawMotion: + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: case XI_DeviceChanged: case XI_HierarchyChanged: case XI_PropertyEvent: diff --git a/dix/getevents.c b/dix/getevents.c index ea62ca8b8..d7d6c09ec 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -161,7 +161,16 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail) memset(event, 0, sizeof(RawDeviceEvent)); event->header = ET_Internal; event->length = sizeof(RawDeviceEvent); - event->type = ET_RawKeyPress - ET_KeyPress + type; + switch(type) { + case MotionNotify: event->type = ET_RawMotion; break; + case ButtonPress: event->type = ET_RawButtonPress; break; + case ButtonRelease: event->type = ET_RawButtonRelease; break; + case KeyPress: event->type = ET_RawKeyPress; break; + case KeyRelease: event->type = ET_RawKeyRelease; break; + case XI_TouchBegin: event->type = ET_RawTouchBegin; break; + case XI_TouchUpdate: event->type = ET_RawTouchUpdate; break; + case XI_TouchEnd: event->type = ET_RawTouchEnd; break; + } event->time = ms; event->deviceid = dev->id; event->sourceid = dev->id; diff --git a/include/eventstr.h b/include/eventstr.h index 96260760a..332307374 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -67,6 +67,9 @@ enum EventType { ET_RawButtonPress, ET_RawButtonRelease, ET_RawMotion, + ET_RawTouchBegin, + ET_RawTouchUpdate, + ET_RawTouchEnd, ET_XQuartz, ET_Internal = 0xFF /* First byte */ }; @@ -384,6 +384,9 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchEnd: + case ET_RawTouchUpdate: event->raw_event.deviceid = dev->id; break; default: |