touchpad: basic thumb detection within gestures
authorMatt Mayfield <mdmayfield@users.noreply.github.com>
Sat, 18 Aug 2018 06:10:34 +0000 (01:10 -0500)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 15 Jul 2019 03:08:47 +0000 (13:08 +1000)
commit7b9a6a94a37cc659d3888c4de25deaca9bd4bed6
tree7e300f4fb095ffba1736cdf73e6b6c0479738330
parent7fbfb14419143d75466a68408942d9d460860d04
touchpad: basic thumb detection within gestures

When a touchpad has thumb detection enabled, avoid false-positive gestures
involving a resting thumb by using two thresholds: inner and outer.

While both touches remain inside their inner thresholds, remain in UNKNOWN
state to allow for accurate gesture detection even with no timeout.

If both touches move outside their inner thresholds, start a pinch or
swipe/scroll gesture according to direction, as usual.

If one touch moves outside its outer threshold while the other has not yet
exceeded its inner threshold, and thumb detection is enabled, then if one
touch is >20mm lower, mark it as a thumb and cancel the gesture.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-gestures.c
test/test-gestures.c