This is an old recording and predates properties. It's not a clickpad, we
assume INPUT_PROP_POINTER is set.
From: https://bugs.freedesktop.org/attachment.cgi?id=57154
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If a device sends other events at startup, those events weren't freed. This
can happen on tablet devices that send proximity events immediately after
DEVICE_ADDED.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
udev requires callout binaries to sit in /lib/udev or otherwise provide an
absolute path. The test suite should work without installing everything first,
so create two rule files - one to install, one with the path to the
$builddir/test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
The touchpads currently all send a default value of 30 for ABS_PRESSURE. For
some tests we want to have a custom pressure but changing all tests isn't
sensible. So hook each device up to send a default value of 30 if it isn't
overridden in the test itself.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
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>
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>
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>
Adds the macros ck_assert_double_{eq,ne,lt,gt,le,ge} to compare double
values using a fixed tolerance value. The tolerance value is
picked based on the range of values to be expected by the libinput API.
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This device provides a circular touch point size and and hence lacks
orientation. It will be used to test default value handling.
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Adds a device with various touch related axes and respective device features
to litest.
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This change adds strict axis_replacement and litest_touch_move_extended
and litest_touch_down_extended to simulate changes to other axes during
touch down and move events.
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
Extend the touchpad gesture API with pinch gestures. Note that this
new API offers a single event stream for both pinch and rotate data, this
is deliberate as some applications may be interested in getting both at
the same time. Applications which are only interested in one or the other
can simply ignore the other.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
For touchscreens we always send raw touch events to the compositor, and the
compositor or application toolkits do gesture recognition. This makes sense
because on a touchscreen which window / widget the touches are over is
important context to know to interpret gestures.
On touchpads however we never send raw events since a touchpad is an absolute
device which primary function is to send pointer motion delta-s, so we always
need to do processing (and a lot of it) on the raw events.
Moreover there is nothing underneath the finger which influences how to
interpret gestures, and there is a lot of touchpad and libinput configuration
specific context necessary for gesture recognition. E.g. is this a clickpad,
and if so are softbuttons or clickfinger used? What is the size of the
softbuttons? Is this a true multi-touch touchpad or a semi multi-touch touchpad
which only gives us a bounding box enclosing the fingers? Etc.
So for touchpads it is better to do gesture processing in libinput, this commit
adds an initial implementation of a Gesture event API which only supports swipe
gestures, other gestures will be added later following the same model wrt,
having clear start and stop events and the number of fingers involved being
fixed once a gesture sequence starts.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
When the condition with continue was hit, syspath was still compared in the
loop condition, leading to crashes when strcmp()-ing a random string.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This test doesn't really test for that because the kernel shouldn't forward
these events to us in the first place. It's merely a canary to warn us if this
ever changes and we end up not ignoring the events.
The test is only run for one device (the default mouse), no need to waste more
time on this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Since 69449ca854, the minimum deceleration is 0.3 and we don't get a 0 motion
event anymore. We can drop the helper function now too.
What we do in that test instead is pump one relative motion event through
before we start comparing the events, this way our second, third, .. events
will have some acceleration applied and the tests compare more accurate
values.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We can't easily test for DMI matches, but anything that hooks onto pid/vid is
easy to verify for correctness.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop the busy loop we had waiting for an event to appear and just call poll on
the libinput fd.
This actually makes the tests more correct, if we now time out where we didn't
before it means we're not setting the timers correctly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
3s is too easy to hit on congested systems. 10s is overkill, but it's still
better to pass a test late than having to restart the whole test-suite again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Set up a udev_monitor before each device creation and wait for the monitor to
notify us of the newly created device. This should take the place of the
various sleep loops we currently have sprinkled around the code and provide a
reliability when testing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hitting this limit too often on congested VMs, so let's increase the sleep
sleep (so the system can get done what needs to be done) and get the whole
timeout from 600ms to 2000ms.
Note: if we really hit 2000ms we may still fail on some tests with the check's
default 3 second timeout.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Quite similar to wacom tablets but the evdev protocol differs - no serials for
example and only two tools. The device has a wheel, but it's not apparently
part of the stylus like on the wacom tablets. And it has a bunch of keys.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Similar to tapping, it's a feature that is useful but confusing if a user
doesn't know it exists. It makes the touchpad appear laggy and slow to react
in the best case, or appear like a stuck button in the worst case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>