diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-05-02 09:44:37 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-05-02 09:44:37 +0930 |
commit | fe33724ed6cdaad6b13a7ca1c9f03dbb98d93982 (patch) | |
tree | 259115631cea0662bfe86946fee711cdb1faaa33 /src/XExtToWire.c | |
parent | 44ccc08bb19d9d55fb9ff6bfb0592d5d79b9b712 (diff) |
Add deviceid and ev-to-wire conversion for RawDeviceEvent.
Diffstat (limited to 'src/XExtToWire.c')
-rw-r--r-- | src/XExtToWire.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/XExtToWire.c b/src/XExtToWire.c index 163dd4a..6c48335 100644 --- a/src/XExtToWire.c +++ b/src/XExtToWire.c @@ -514,6 +514,29 @@ _XiEventToWire(dpy, re, event, count) pcev->keyboard = ev->keyboardid; break; } + case XI_RawDeviceEvent: + { + int i; + CARD32* valptr; + XRawDeviceEvent* ev = (XRawDeviceEvent*)re; + rawDeviceEvent* rev; + *count = 1; + rev = (rawDeviceEvent*)Xmalloc(*count * (sizeof(xEvent) + ev->num_valuators * sizeof(CARD32))); + if (!rev) + return (_XUnknownNativeEvent(dpy, re, *event)); + + *event = (xEvent*)rev; + rev->type = ev->type; + rev->extension = ev->extension; + rev->deviceid = ev->deviceid; + rev->buttons = ev->buttons; + rev->num_valuators = ev->num_valuators; + rev->first_valuator = ev->first_valuator; + valptr = &rev->valuator0; + for(i = 0; i < ev->num_valuators; i++, valptr++) + *valptr = ev->valuators[i]; + break; + } default: return (_XUnknownNativeEvent(dpy, re, *event)); } |