Commit graph

178 commits

Author SHA1 Message Date
Peter Hutterer
058d05e589 touchpad: only enable thumb detection on clickpads
The use-case we have thumb detection for is to let a user rest a thumb on the
touchpad before clicking. On a touchpad with physical buttons, the thumb won't
be resting on the touchpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-21 16:35:31 +10:00
Peter Hutterer
c06a173e58 touchpad: skip thumb detection for touchpads smaller than 50mm
Gets a bit cramped if you're trying to rest the thumb on a touchpad that
small.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-21 16:35:31 +10:00
Peter Hutterer
9d0c767122 touchpad: reduce unpin threshold to 1.5mm
3mm is too large, it makes the touchpad feel sluggish. We already take fuzz
into account through the hysteresis and the real issue we have with the
pointer moving on a click is _before_ the BTN_LEFT event comes in, not after.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-21 16:29:12 +10:00
Peter Hutterer
ecda01eb4c test: add 3fg and 4fg clickfinger tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-20 11:18:03 +10:00
Peter Hutterer
35fb5412c5 test: remove some excessive linebreaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 15:41:13 +10:00
Peter Hutterer
55435a707f test: add an Apple Magic Trackpad test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:13 +10:00
Peter Hutterer
74a8d6546e test: move finger position to test for right button down
On large touchpads with resolution, 90% of the touchpad may be north of the
button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:13 +10:00
Peter Hutterer
fa67be9e3c test: reduce movement of finger while pinned
Otherwise the test fails on large touchpads with resolution (magic trackpad).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:09 +10:00
Peter Hutterer
3734a67eef test: slow down 2fg slow scroll movement
To avoid test case failures when we switch to forced resolutions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-10 11:43:42 +10:00
Peter Hutterer
cc59c8986f test: add touchpad thumb detection tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:27:53 +10:00
Peter Hutterer
7d314738fb touchpad: be smarter about clickfinger thumb detection
Watching a colleague try clickfinger right-click after enabling it the first
time showed that the vertical distance is too small. Increase it to 30mm
instead.

Increase the allowed spread between fingers to 40x30mm, but check if one of
the fingers is in the bottom-most 20mm of the touchpad. If that's the case,
and the touchpad is large enough to be feasable for resting a thumb on it,
discard the finger for clickfinger count.

If both fingers are in that area or one finger is in the area and they're
really close together, the fingers count separately and are not regarded as
thumb.

https://bugs.freedesktop.org/show_bug.cgi?id=91046

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
abff4a1c24 touchpad: allow edge scrolling on clickpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
77aca3c194 test: add helper function for enabling click methods
Makes the test code easier to read. In tests where we explicitly check the API
the real calls were left in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Peter Hutterer
9a8238836e test: move enable_edge_scroll up
No functional changes, just so we can group those helpers together.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09 11:24:17 +10:00
Hans de Goede
ad26785f6a touchpad: Implement pinch gesture support
Implement touchpad pinch (and rotate) gesture support.

Note that two two-finger scrolling tests are slightly tweaked to assure that
there is enough touch movement to allow the scroll-or-pinch detect code to do
its work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:09:33 +10:00
Peter Hutterer
3fcdba6ca6 test: replace tap config with helper function
No functional change, other than that we check for status codes now too.
In tests that don't specifically check the interface itself, a short
enable_tap() or disable_tap() is a lot more obvious to parse for the reader.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00
Peter Hutterer
51b694e282 touchpad: disable right-edge palm detection for edge scrolling
Most scroll motions would be labelled a palm.

https://bugs.freedesktop.org/show_bug.cgi?id=90980

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22 08:07:12 +10:00
Peter Hutterer
9c2afae146 test: move tapping tests into a separate binary
The previous set hit _some_ sort of limit, but no idea what or why. When
adding one more test, the touchpad test case would reliably fail with a udev
timeout in litest_wait_for_udev(). This only happened in the valgrind case,
the normal run succeeded. Reproduced on three different installations (2 vms
on two different hosts).

Move the tapping tests into a separate binary, this unwedges whatever was
unhappy and sunshine, lollipops and rainbows are distributed generously.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22 08:07:07 +10:00
Peter Hutterer
83015f9dca test: switch clickpad multitap to a ranged test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-18 13:36:22 +10:00
Peter Hutterer
bc9f16b40e COPYING: Update boilerplate from MIT X11 to MIT Expat license
To quote Bryce Harrington from [1]:
"MIT has released software under several slightly different licenses,
including the old 'X11 License' or 'MIT License'.  Some code under this
license was in fact included in X.org's Xserver in the past.  However,
X.org now prefers the MIT Expat License as the standard (which,
confusingly, is also referred to as the 'MIT License').  See
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING

When Wayland started, it was Kristian Høgsberg's intent to license it
compatibly with X.org.  "I wanted Wayland to be usable (license-wise)
whereever X was usable."  But, the text of the older X11 License was
taken for Wayland, rather than X11's current standard.  This patch
corrects this by swapping in the intended text."

libinput is a fork of weston and thus inherited the original license intent
and the license boilerplate itself.

See this thread on wayland-devel here for a discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-May/022301.html

[1] http://lists.freedesktop.org/archives/wayland-devel/2015-June/022552.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
2015-06-16 14:36:04 +10:00
Peter Hutterer
8025b374d5 touchpad: set the finger pin distance to 5mm where possible
On touchpads with resolutions, use a 5mm motion threshold before we unpin the
finger (allow motion events while a clickpad button is down). This should
remove any erroneous finger movements while clicking, at the cost of having to
move the finger a bit more for a single-finger click-and-drag (use two fingers
already!)

And drop the finger drifting, it was per-event based rather than time-based.
So unless the motion threshold was hit in a single event it was possible to
move the finger around the whole touchpad without ever unpinning it.

Drop the finger drifting altogether, if the touchpad drifts by more than 5mm
we have other issues.

https://bugzilla.redhat.com/show_bug.cgi?id=1230462

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-16 10:18:48 +10:00
Peter Hutterer
8af1f4b085 touchpad: on non-resolution touchpads, use 30% as maximum clickfinger spread
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-03 14:43:58 +10:00
Peter Hutterer
df83144457 touchpad: impose maximum distance limits on clickfingers
A common use-case for clickfinger is to use the index finger for moving the
pointer, then triggering the click with a thumb. If the index finger isn't
lifted before the click this counted as two-finger click.

To avoid this, check the distance between touches on the touchpad (on
touchpads reporting resolution values anyway). If the touches are too far
apart, don't count them together (or specifically only count those close
enough together as multi-finger).

The touch area is uneven, it's wider than high. Spreading fingers horizontally
is more common and this also makes it easier to rule out thumbs which tend to
be well below the fingers.

http://bugs.freedesktop.org/show_bug.cgi?id=90526

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-03 14:43:58 +10:00
Peter Hutterer
289e4675c8 filter: enforce minimum velocity
In the current code, a timeout or direction change on the first tracker will
result in a velocity of 0. Really slow movements will thus always be zero, and
the first event after a direction is swallowed.

Enforce a minimum velocity:
In the case of a timeout, assume the current velocity is that of
distance/timeout. In the case of a direction change, the velocity is simply
that since the last tracker.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-02 09:03:07 +10:00
Peter Hutterer
0dc058a0c7 touchpad: touches after the last key press can be released
The current code labels a touch as palm if it started within the typing
timeouts. To move the pointer even after the timeout expires, a user has to
lift the finger which is quite annoying and different to the old synaptics
driver behaviour (which had a simple on/off toggle on whether to let events
through or not).

Be smarter about this: if a touch starts _after_ the last key press event,
release it for pointer motion once the timeout expires. Touches started before
the last key press remain labelled as palms. This makes it possible to rest
the palm on the touchpad while typing without getting interference but also
provides a more responsive UI when moving from typing to using the touchpad
normally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
f85a46b661 touchpad: don't enable edge palm detection on Wacom touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
00c75a2667 test: add disable-while-typing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
3a7264a03e touchpad: be finer-grained about when to pair touchpads/keyboard for DWT
Check a couple of easy yes/no definitives that cover most Lenovo laptops,
and avoid false positives on Wacoms.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
a6be43990c Merge branch 'litest-filter-tests'
The litest-selftest has its own main method and compiles litest.c with special
flags. Use that to ifdef out the litest.c main function, and inline the
litest_run/litest_parse_args functions so gcc doesn't complain about unused
functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 09:15:15 +10:00
Peter Hutterer
9dbeb9d0f7 test: move main() into litest
This allows us to filter things based on argv before setting up tests, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 08:45:33 +10:00
Peter Hutterer
af4ff07f6b touchpad: sync the initial touch state
Unlikely, but there's the odd chance of the first touch coming in with the
same X or Y coordinate the kernel already has internally. This would
generate a bogus delta on the second event when the touch coordinate jumps
from 0/y or x/0 to the real coordinates.

For touchpads with distance support this is a real issue since the default
value for a touch distance is > 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-21 21:41:48 +10:00
Peter Hutterer
ed5d43da36 Merge branch 'litest-backtrace' 2015-05-21 11:05:45 +10:00
Peter Hutterer
cd163b3b8a Allow disabling tapping on a device without tapping
The doc says this "always succeeds", not "segfaults".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-19 16:57:47 +10:00
Peter Hutterer
13c7b47d87 test: convert all helper functions to use the litest macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 20:55:48 +10:00
Peter Hutterer
46171fbef3 Merge branch 'tap-to-end-drag'
Changed the test merged in to use the new ranged litests functionality

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 14:12:12 +10:00
Velimir Lisec
2e0f45b537 test: add test cases for ending drag with a tap
Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-18 14:10:17 +10:00
Peter Hutterer
893fdf9b83 test: switch the touchpad multitap tests over to ranged tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-08 14:08:58 +10:00
Peter Hutterer
4a56ce17f0 test: use litest_is_button_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 16:18:10 +10:00
Benjamin Tissoires
0cd36225d7 touchpad: add support for per-finger hovering information
When the device supports true hovering, it reports this
information through ABS_MT_DISTANCE.
When this axis is available, we should rely on it to
(un)hover the touches as BTN_TOUCH is most of the time
unreliable (generated by the mouse emulation in the kernel).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-07 14:40:53 +10:00
Benjamin Tissoires
92fc816bfe test: rename hover tests into semi_mt_hover
The current hover tests are uniquely designed for some Synaptics
touchpad. libinput can handle hovering through ABS_MT_DISTANCE,
so we need to reserve the "hover" name for real hovering devices.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 15:08:36 +10:00
Peter Hutterer
d8ec73aead test: add timeout_tapndrag()
Prep work for the upcoming patch to extend the timeout for tap-and-drag.  And
switch the tests that rely on it over to the new function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-04 10:22:58 +10:00
Peter Hutterer
6dd02468ac test: reduce the multitap tests to 5 taps only
Reduces the risk of accidental timeouts

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-04 10:22:58 +10:00
Peter Hutterer
8ead828e6f Fix a couple of coding style issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-01 12:09:57 +10:00
Peter Hutterer
1352fe0432 test: fix touch up for multitap-n-drag test
Released the wrong touch point, causing warnings:
libevdev error in sanitize_event: BUG: Device "litest SynPS/2 Synaptics
TouchPad" received a double tracking ID 6 in slot 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-28 11:53:11 +10:00
Peter Hutterer
5254977fce test: add semi-mt 2fg scroll test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-27 11:10:32 +10:00
Hans de Goede
07b20dcce6 touchpad: Only use slot 0 deltas for 2fg scrolling on semi-mt touchpads
Some semi-mt model touchpads have a better accuracy for slot 0 then for
slot 1 (they only have 2), so on semi-mt models only use the movement of
the touch in slot 0 for 2fg scrolling, rather then the average movement of
the 2 touches.

This fixes 2fg scrolling being choppy / jumpy in some cases.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89683
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Also needed: change the touchpad scroll source test to use more separate
events. The current litest semi-mt touch implementation only moves the first
touch on every second move. With 5 movements this isn't enough to fill the
motion history and generate events, so double it to 10 so we're guaranteed to
get scroll events.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-27 11:08:52 +10:00
Peter Hutterer
c14d7063b7 touchpad: allow BTN_LEFT in clickfinger mode without touches
On the Logitech T650 it's quite easy to trigger a click without touching the
surface. For software buttons we discard those clicks because we can't tell
where the finger is to decide on left vs right click.

It takes effort to trigger a click with two fingers without triggering a touch
though, so in clickfinger mode post a click without touches as single-finger
click.

https://bugs.freedesktop.org/show_bug.cgi?id=90150

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-27 09:04:27 +10:00
Hans de Goede
b81afb019a test-touchpad: Adjust touchpad_edge_scroll_no_2fg test for gesture support
Unlike all the other 2fg scroll tests the touchpad_edge_scroll_no_2fg test
puts the 2 fingers down quite far apart, this makes the pinch vs scroll
gesture detection code in the gestures branch detect a pinch causing the
test to fail.

This commit brings the finger placement in line with the other 2fg scroll
tests fixing this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-23 10:32:31 +10:00
Peter Hutterer
c2f267b443 touchpad: don't post 2fg scrolling when edge scrolling is enabled
https://bugs.freedesktop.org/show_bug.cgi?id=90070

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-21 17:59:12 +10:00
Peter Hutterer
4cdb810bc8 test: adjust the movement size for edge scroll timeout testing
The goal of this test is to make sure that the deltas are less than 5, which
is the scroll trigger for movement-based edge scrolling. The litest suite
takes percentages of the device, so use a scale factor to change how far we
move on the tablet. The wacom tablet is 141mm, the movement must be smaller to
provide small-enough deltas.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-21 17:58:10 +10:00