• Peter Hutterer's avatar
    touchpad: use motion speed to ignore accidental 2fg touches · de5246da
    Peter Hutterer authored
    Calculate the speed of the touch and compare it against a fixed speed limit.
    If a touch exceeds the speed when a second touch is set down, that second
    touch is marked as a thumb and ignored (unless it's right next to the other
    finger, then it's likely a 2fg scroll).
    The speed calculation is simple but has to lag behind by one sample - we reset
    the motion history whenever a new finger is set down (to avoid pointer jumps)
    so we need to know if the finger was moving fast *before* this happens. Plus,
    with the pointer jumps we're more likely to get false positives if we
    calculate the speed on actual finger down.
    This is the simplest version for now, the speed varies greatly between
    movements and should probably be averaged across the last 3-or-so samples.
    https://bugs.freedesktop.org/show_bug.cgi?id=99703Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
test-touchpad.c 161 KB