Commit graph

14 commits

Author SHA1 Message Date
Peter Hutterer
8fdeba9ea2 test: wrap slot counting into a helper function
This is prep work for future devices that announce a wrong slot count. For the
tests this can be a problem if we rely on the correct slot count to decided
whether to run a test or not.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 15:58:49 +10:00
Peter Hutterer
df7b82588d test: fix a coverity warning about an unused value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-30 11:18:27 +10:00
Peter Hutterer
cb1be90439 gestures: where we have more fingers than slots, default to swipe
Fixes #360

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-25 04:10:02 +00:00
Matt Mayfield
e97f054917 gestures: improve scroll responsiveness for vertically aligned touches
Put some basic location checks in, if the fingers are next to each other and
vertically close, assume scroll over swipe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
2019-07-15 13:08:47 +10:00
Matt Mayfield
7b9a6a94a3 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>
2019-07-15 13:08:47 +10:00
Peter Hutterer
8f8ad0e31b test: use an enum for the cardinals
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-20 22:16:15 +00:00
Peter Hutterer
803a99ac05 test: fix a bunch of tests expecting BTN_TOOL_TRIPLETAP
A device may have 1 or 2 slots without setting BTN_TOOL_TRIPLETAP, those
devices will fail those tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-08 14:09:28 +10:00
Peter Hutterer
7768d7d981 test: drop the sleep_ms argument
This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.

Cocinelle spatch files were variants of:
	@@
	expression A, B, C, D, E, F, G, H, I, J, K;
	@@

	- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
	+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)

The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 11:26:12 +10:00
Peter Hutterer
20a9c38db0 test: force 10ms intervals for touch moves, unless specified otherwise
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-28 11:26:12 +10:00
Peter Hutterer
c2877fdb0c test: don't use move_to for a single-step movement
If we only want one event anyway...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 17:21:45 +10:00
Peter Hutterer
ce80e40006 test: move all the _setup() functions into a special section
This way we can loop through them instead of having to add them manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-23 10:17:52 +10:00
Peter Hutterer
3ddabb7739 test: fix typo in test case name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-17 02:03:15 +02:00
Peter Hutterer
6d435cda06 gestures: don't try to pinch for nfingers > slots
We don't know the position of the third finger on 2-slot touchpads, differing
between swipe and pinch is reliable. Simply disable 3-finger pinch and always
use swipe; 3fg pinch is uncommon anyway and it's better to have one of the
gestures working reliably than both unreliably.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-08-01 16:42:03 +01:00
Peter Hutterer
5d66edc9f4 test: prefix all test source files with "test-"
They weren't originally prefixed but the various tests were, but now that we
only have one test runner binary anyway, the prefix helps sorting the files
easily within e.g. gcov results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:00 +10:00
Renamed from test/gestures.c (Browse further)