diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-20 10:56:22 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-20 11:09:37 +1000 |
commit | f3c628acc4f7399325756590cdc72e769341243c (patch) | |
tree | 391fc00b15b65081a2304cb4fa6a7c29d77bfcad /src | |
parent | fed454192ddc4ad94226040c657deb6abea3df88 (diff) |
Map ABS_MT_POSITION_X/Y into ABS_X/Y
MT axes are the same as traditional axes, so one into the other so we get
x/y coordinates regardless wich axes it comes from.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c index 8adfefd..9a5608b 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -748,7 +748,12 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev) else pEvdev->slot_state = SLOTSTATE_CLOSE; } else { - map = pEvdev->axis_map[ev->code] - pEvdev->num_vals; + if (ev->code == ABS_MT_POSITION_X) + map = pEvdev->axis_map[ABS_X]; + else if (ev->code == ABS_MT_POSITION_Y) + map = pEvdev->axis_map[ABS_Y]; + else + map = pEvdev->axis_map[ev->code] - pEvdev->num_vals; valuator_mask_set(pEvdev->mt_mask, map, ev->value); } } |