Don't sync the MT state for fake MT devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 5 Mar 2014 03:15:20 +0000 (13:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 6 Mar 2014 04:30:03 +0000 (14:30 +1000)
commit12ff51b8710aca9640caacf02a941ec8ff234348
tree981c4b4cdf7e8ea505eb117165b9eff2bb6f2975
parent68a297577aed60bb81afc5e8bcfe0e3d2e95185f
Don't sync the MT state for fake MT devices

Devices with ABS_MT_SLOT-1 are fake MT devices, they merely overlap the
axis range but don't actually provide slots. The EVIOCGABS ioctl won't work to
retrieve the current value - the kernel does not store values for those axes
and the return value is always 0.

Thus, simply ignore those axes for fake MT devices and instead rely on the
next event to update the caller with the correct state for each axis.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
libevdev/libevdev.c
libevdev/libevdev.h
test/test-libevdev-events.c