aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/eventconvert.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
committermarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
commit6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6 (patch)
tree02e0d5fd297602d526b582dc527e007fe20a326f /xorg-server/dix/eventconvert.c
parent1d142834bdb30308784a0654a39b7c0de7e37695 (diff)
parenteaedc21febeadad4cf0e370f5d97e7bdb4470870 (diff)
downloadvcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.gz
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.bz2
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix/eventconvert.c')
-rw-r--r--xorg-server/dix/eventconvert.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c
index d5ac54796..6af142860 100644
--- a/xorg-server/dix/eventconvert.c
+++ b/xorg-server/dix/eventconvert.c
@@ -383,38 +383,35 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
int i;
int state = 0;
int first_valuator, num_valuators;
+ DeviceIntPtr dev = NULL;
num_valuators = countValuators(ev, &first_valuator);
if (num_valuators > 0)
{
- DeviceIntPtr dev = NULL;
dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
/* State needs to be assembled BEFORE the device is updated. */
state = (dev && dev->key) ? XkbStateFieldFromRec(&dev->key->xkbInfo->state) : 0;
state |= (dev && dev->button) ? (dev->button->state) : 0;
}
- /* FIXME: non-continuous valuator data in internal events*/
for (i = 0; i < num_valuators; i += 6, xv++) {
+ INT32 *valuators = &xv->valuator0; // Treat all 6 vals as an array
+ int j;
+
xv->type = DeviceValuator;
xv->first_valuator = first_valuator + i;
xv->num_valuators = ((num_valuators - i) > 6) ? 6 : (num_valuators - i);
xv->deviceid = ev->deviceid;
xv->device_state = state;
- switch (xv->num_valuators) {
- case 6:
- xv->valuator5 = ev->valuators.data[xv->first_valuator + 5];
- case 5:
- xv->valuator4 = ev->valuators.data[xv->first_valuator + 4];
- case 4:
- xv->valuator3 = ev->valuators.data[xv->first_valuator + 3];
- case 3:
- xv->valuator2 = ev->valuators.data[xv->first_valuator + 2];
- case 2:
- xv->valuator1 = ev->valuators.data[xv->first_valuator + 1];
- case 1:
- xv->valuator0 = ev->valuators.data[xv->first_valuator + 0];
+
+ for (j = 0; j < xv->num_valuators; j++) {
+ if (BitIsOn(ev->valuators.mask, xv->first_valuator + j))
+ valuators[j] = ev->valuators.data[xv->first_valuator + j];
+ else if (dev->valuator->axes[xv->first_valuator + j].mode == Absolute)
+ valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
+ else
+ valuators[j] = 0;
}
if (i + 6 < num_valuators)