In order to distinguish tap gestures from short movements, the touchpad
input driver in wsmouse checks whether the distance between the initial
and the last position of a touch exceeds the 'maxdist' limit.  Some
touchpads provide unreliable coordinates when more than one contact is
being made simultaneously, and in this case the filter may be too strong
- and superfluous, because only one-finger contacts should trigger pointer
movement; it should be safe to skip the test for multi-finger contacts
(with Non-MT-touchpads, it isn't possible anyway).

OK?


Index: dev/wscons/wstpad.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wstpad.c,v
retrieving revision 1.28
diff -u -p -r1.28 wstpad.c
--- dev/wscons/wstpad.c 21 Mar 2021 16:20:49 -0000      1.28
+++ dev/wscons/wstpad.c 23 Mar 2021 09:09:42 -0000
@@ -657,14 +657,8 @@ wstpad_is_tap(struct wstpad *tp, struct
        struct timespec ts;
        int dx, dy, dist = 0;

-       /*
-        * No distance limit applies if there has been more than one contact
-        * on a single-touch device.  We cannot use (t->x - t->orig.x) in this
-        * case.  Accumulated deltas might be an alternative, but some
-        * touchpads provide unreliable coordinates at the start or end of a
-        * multi-finger touch.
-        */
-       if (IS_MT(tp) || tp->tap.contacts < 2) {
+       /* Try to distinguish one-finger taps from short movements. */
+       if (tp->tap.contacts == (tp->ignore ? 2 : 1)) {
                dx = abs(t->x - t->orig.x) << 12;
                dy = abs(t->y - t->orig.y) * tp->ratio;
                dist = (dx >= dy ? dx + 3 * dy / 8 : dy + 3 * dx / 8);

Reply via email to