tablet: add tilt-based touch arbitration for screen tablets
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 28 Sep 2018 01:47:32 +0000 (11:47 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 31 Jan 2019 05:17:28 +0000 (05:17 +0000)
commitf612c1ef0c8d2f41c1693c5c4801f13a4df836a1
tree430a8e978251288ef4cdb4359ac842eb4e901140
parentf325ca921dede43b87286b2fff510c5dfacb3c93
tablet: add tilt-based touch arbitration for screen tablets

If the tilt angle on tip down is not 0 set the touch arbitration to a
rectangle around the assumed position of the hand. This assumed position is
right of the tip for a rightwards tilt and left of the tip for a leftwards
tilt (i.e. left-handed mode). The rectangle is 200x200mm with a 20x50mm
NW of the tip or NE for left-handed. In other words, if the period below is
the tip, the rectangle looks like this:

    +-----------+                          +-----------+
    | .  | <- for rightwards tilt   |         . |
    |           |                          |           |
    |           |                          |           |
    |           |    for leftwards tilt -> |           |
    +-----------+                          +-----------+

Touches within that rectangle are canceled, new touches are ignored. As the
tip moves around the rectangle is updated but touches are only cancelled on
the original tip down. While the tip is down, new touches are ignored in the
exclusion area but pre-existing touches are not cancelled.

This is currently only implemented in the fallback interface, i.e. it will
only work for Cintiqs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-fallback.c
src/evdev-tablet.c
src/evdev-tablet.h
test/litest.c
test/litest.h
test/test-tablet.c