Commit graph

262 commits

Author SHA1 Message Date
Peter Hutterer
77eb2d5445 test: add litest_is_motion_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Peter Hutterer
2e38547c79 test: add litest_is_axis_event() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +10:00
Peter Hutterer
799ee6c53e test: litest_is_button_event should take an unsigned int
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-07 14:40:59 +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
Peter Hutterer
1ea69203ac test: return the right value from open_restricted
fd or negative errno on failure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 11:56:40 +10:00
Peter Hutterer
3844856302 test: move a comment to where it belongs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-06 11:56:40 +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
a7b2d04e90 evdev: enable button scrolling by default on mice without wheels
If we have a middle button but no wheels, enable on-button scrolling for the
middle button by default. This applies e.g. to the Logitech trackball added as
new test device here.

This makes the separate check for POINTINGSTICK obsolete but I'd rather leave
this in to be more explicit about it.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-28 17:12:31 +10:00
Peter Hutterer
9191010ac2 test: add the MS Surface Type Cover to the list of devices
Added in d2842893a8 but never added to the list
of devices so none of the tests ran against it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-04-27 13:24:41 +10:00
Peter Hutterer
776bf4938d evdev: accept but disable ABS_MISC and above for min/max == 0
This is sort-of legitimate, so simply disable the axes and continue.
Any real axis we require to have a real range.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-21 11:36:19 +10:00
Peter Hutterer
88d1a52670 test: add litest_is_button_event
Makes it easier from a caller to check for common things without all the other
boilerplate code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-17 12:59:22 +10:00
Peter Hutterer
75f15917a3 evdev: add support for middle button emulation
This is just the required framework, it's not hooked up to anything just yet.
Hooking it up comes as separate commit to better detail why/when a device
supports emulation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-17 12:50:03 +10:00
Peter Hutterer
bd6fd8bb92 test: add a scrollwheel-only device
This currently requires a specific udev rule to tag the device, once the
matching bits are upstream we can drop this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-13 11:48:38 +02:00
Peter Hutterer
7ea7746c77 test: add the Razer BlackWidow keyboard device
This device has a couple of axes (fake MT) and a wheel. The device itself
exports 4 nodes, this device is the second node, the most problematic one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-08 11:42:50 +02:00
Peter Hutterer
2876575d06 Merge branch 'master' into tablet-support 2015-03-18 14:37:46 +10:00
Peter Hutterer
7f28b714d8 Replace event type check switch statements with a helper macro/function
The helper function now prints an error message if the event type passed is
not allowed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-16 08:07:38 +10:00
Peter Hutterer
44f7446b2a test: abort() for invalid logging priorities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-16 08:07:37 +10:00
Hans de Goede
a8eb6c84a2 litest: Add a litest_touch_move_two_touches helper function
Currently all the touchpad 2fg tests move the 2 fingers 1 at a time,
causing a finger motion which looks more like a pinch zoom in followed by
a zoom out than an actual 2fg scroll gesture. Add a helper function which
can move 2 fingers at the same time (more or less), and use this where
relevant.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 11:28:36 +10:00
Peter Hutterer
d3fb0b1ea2 Merge branch 'master' into tablet-support 2015-03-10 11:28:57 +10:00
Peter Hutterer
1cebdc7a2b touchpad: accumulate the initial scroll edge delta
The previous setting of 10 wasn't 10 mm, it was used against the deltas
normalized to a 1000DPI mouse, i.e. closer to 4mm. It was also also per-event,
so a slow movement or a high-frequency touchpad can struggle to meet the
threshold.

Change the trigger to be ~5 mm from the initial touch down, accumulated until
we either meet the threshold or the timeout expires. The first scroll event
includes the delta since the touch down rather than the most recent delta.
This removes the delay otherwise seen in scrolling and makes the scroll motion
match the finger motion. This accumulated delta only applies when exceeding
the motion threshold, when the timeout triggers the switch to scrolling the
first delta posted is the current delta.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-10 07:09:23 +10:00
Peter Hutterer
123bc4024a Merge remote-tracking branch 'origin/master' into tablet-support
Conflicts:
	test/litest.h
2015-03-05 19:16:02 +10:00
Peter Hutterer
aa3d09932f test: add a Wacom Intuos 5 Finger test device
Works as a touchpad but has no buttons.

Minor change to one of the touchpad tests: because the touch area is so big
the slow-scrolling trigger needs to be adjusted.

And because the device is an external device, the "disable on external mouse"
test needs to be adjusted.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-05 13:30:49 +10:00
Peter Hutterer
ea77fd3272 Merge branch 'master' into tablet-support
Conflicts:
	test/litest.h
	test/valgrind.suppressions
2015-03-02 13:57:17 +10:00
Peter Hutterer
3288349077 test: add litest_assert_tablet_button_event()
Does what it says on the box. or at least in the manual inside the box.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:19:00 +10:00
Peter Hutterer
72cc601007 test: add protocol A touch screen tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-02 12:45:47 +10:00
Hans de Goede
18887f90ee touchpad: Gesture support preparation
Handle everything which is not handled by the tap, (soft)button or edge-scroll
code/statemachines in a unified way. Everything is treated as a X-finger
gesture now, and the action to take on finger movement is decided by
the gesture.finger_count setting. Pointer control now simply is seen as a
1 finger gesture, and 2fg scrolling as a 2fg gesture.

This removed the need for special-casing things like switching back to
pointer mode when lifting a finger in 2fg scrolling mode, and also lays the
groundwork for adding 3+ fg gesture support.

Note that 1 test-case needs to be updated to wait for the finger mode
switching when switching mode while a gesture has already been started.
This is actually an improvement as this stops sending spurious pointer
motion events at the end of 2fg scrolling when not lifting both fingers at
exactly the same time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 10:01:02 +01:00
Peter Hutterer
115e68476e Merge branch 'master' into tablet-support 2015-02-20 10:16:21 +10:00
Peter Hutterer
ed0f0bf494 test: fix Coverity complaints
seat_button_count
seat_key_count ... uninitialized variable

t = zalloc
s = zalloc ... dereferencing potential NULL-pointer

d->ntouches_down... side-effect in assertion

Coverity run against the 0.10.0 tag, see
https://scan.coverity.com/projects/4298

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Christian Hartmann <cornogle@googlemail.com>
2015-02-20 10:03:09 +10:00
Stephen Chandler Paul
c7948e3bb5 tablet: Merge PROXIMITY_IN and PROXIMITY_OUT into a single event
There isn't much purpose in having proximity in and out as different events,
combining them into one single event is more consistent with the rest of the
API, and means less code for clients to have to work with.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-18 13:27:29 +10:00
Peter Hutterer
2365f7d3d1 Merge branch 'master' into tablet-support
Added: udev-tag detection for the tablet.
libwacom assigns ID_INPUT_TABLET to all known devices but also
ID_INPUT_TOUCHPAD to all known devices with a touch interface. That's a bug
and should be fixed there but we can work around it by checking both and
making sure only one is set.

Conflicts:
	src/evdev.c
	test/misc.c
2015-02-10 15:23:38 +10:00
Peter Hutterer
633d01d146 0.9.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlTLBSIACgkQ4jt+cLRn8L+4NgCgmgMNoZnmHfNJooSdrRQxzs2t
 8c0An1jHFRAO+9/47m2l2tAzXV2RBaf6
 =b46e
 -----END PGP SIGNATURE-----

Merge tag '0.9.0' into tablet-support

0.9.0

Conflicts:
	test/litest.h
2015-02-05 15:05:36 +10:00
Peter Hutterer
4ec2947cc9 test: add per-device udev rule support
Don't rely on a magic version tag, instead let a device define a udev rule and
drop that into the udev runtime directory before the device is created.

There are a couple of caveats with this approach: first, since this changes
system-wide state it may cause issues on the device the test suite is run on.
This can be avoided if the udev rules have filter patterns that ensure only
test devices are affected.

Second, the check test suite aborts but it doesn't run the teardown() function
if a test fails. So far this wasn't a problem since uinput devices disappear
whenever we exit. The rules files will hang around though, so an unchecked
fixture was added to delete all litest-foo.rules files before and after a test
case starts. Unchecked fixtures are run regardless of the exit status of the
test but run in the same address space - i.e. no ck_assert() usage.

Also unchecked fixtures are only run once per test-case, not once per test
function. For us, that means they're only run once per device (we use the
devices as test case), i.e. if a test fails and the udev rule isn't tidied up,
the next test may be unpredictable. This shouldn't matter too much though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-02-03 10:34:26 +10:00
Peter Hutterer
82bb5841a2 test: add a test device for the Lenovo X1 Carbon 3rd
Notable: sends BTN_0/1/2 instead of the trackpoint

This device currently has the INPUT_PROP_TOPBUTTONPAD property set, kernel
patches [1] and [2] are pending to remove this. This test device already lacks
the property.

[1] https://patchwork.kernel.org/patch/5730371/
[2] https://patchwork.kernel.org/patch/5730451/

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-29 14:40:26 +10:00
Peter Hutterer
c411de1078 test: set the input_id->version as well in litest devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-28 16:28:01 +10:00
Peter Hutterer
35b3992792 Merge branch 'master' into tablet-support
Conflicts:
	test/litest.h
2015-01-20 15:24:34 +10:00
Peter Hutterer
395c449c8e Merge branch 'master' into tablet-support
Conflicts:
	src/libinput.h
2015-01-16 07:55:23 +10:00
Peter Hutterer
62e4b144d2 test: add a semi-mt + hover synaptics touchpad
This device sends touch information before BTN_TOUCH

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-16 07:42:50 +10:00
Peter Hutterer
3d0e4f66f7 test: move semi-mt special tracking into the shared litest.c
An upcoming synaptics semi-mt device needs the same code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-16 07:42:50 +10:00
Peter Hutterer
1baf109b40 Change axis events to carry all directions
Sending separate axis events instead of one unified events is limiting,
especially when simultaneously scrolling in both directions and the caller
tries to implement kinetic scrolling.

Take a page from the tablet-support branch and instead implement the axis
event as a generic event that can contain multiple axes simultaneously.

Right now we only have two (scroll) axes and we could easily just check both
for non-zero values. If we want to allow further axes in the future, we need
a check whether an axis is set in an event, that's what
libinput_event_pointer_has_axis to scroll events() is for.

We also need the mask to notify of a scroll stop event, which could otherwise
be confused as a vertical-only or horizontal-only event.

This is an API and ABI break.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-13 13:54:21 +10:00
Peter Hutterer
c464458f82 test: add helper function for checking for a specific event type
In a few tests we care about that a specific set of events are in the queue
but not about the details of the events (usually checked elsewhere). Instead
of manual loops, provide a helper function that also checks that there is at
least one of those events in the queue.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 11:14:39 +10:00
Peter Hutterer
24b1f2e995 Merge branch 'master' into tablet-support
Manual changes:
* add tablet APIs to libinput.sym
* add the tablet-specific events to litest_event_type_str
* add NULL for device_remove in the tablet interface

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-18 09:47:45 +10:00
Peter Hutterer
e9b160a995 test: print axis event information for debugging too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-11 17:34:05 +10:00
Peter Hutterer
a296a102c7 test: print the string of the event type
Bit quicker to parse than the number

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-11 17:34:05 +10:00
Peter Hutterer
83f97991a0 0.7.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlSBMWUACgkQ4jt+cLRn8L/4JQCgt0u/hImDVk9GLPXpUfFZinRc
 pIgAn1bZ91n/o4nEhq6zOXSsKRoZvxHL
 =oj19
 -----END PGP SIGNATURE-----

Merge tag '0.7.0' into tablet-support

0.7.0

Conflicts:
	src/libinput-private.h
	test/device.c
	test/litest.h
2014-12-08 11:14:11 +10:00
Jonas Ådahl
3b4d8509cc test: Don't send two motion events when button scrolling
Button scrolling motion events don't pass through the acceleration
filter so no need to assume the initial event will be absorbed.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-05 11:54:18 +10:00
Hans de Goede
365141ec60 test: Add litest_button_scroll helper function
Turn test_trackpoint_scroll into a generic helper function for testing
"button scrolling".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-11 12:13:07 +10:00
Peter Hutterer
d7a1addcdd test: rename a parameter to litest_assert_scroll()
This doesn't test for direction only, it tests for the minimum distance we
expect in the scroll event. Rename accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-11 10:00:55 +10:00
Peter Hutterer
1bd5d32463 test: add VMWare Virtual USB Mouse device
Yes, the name has VMware twice, not a typo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-11 09:55:42 +10:00
Peter Hutterer
a0b3af0d91 test: add Xen Virtual Pointer device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-11 09:55:42 +10:00
Peter Hutterer
529d30c7ac test: add QEMU tablet as test device
Re-uses the touch_down interface for now, but requires the slot is always 0.
That's easier for now than adding a new interface for abs event, at least
until we have more than one device that needs it.

This device, along with a couple of similar ones have a tendency to break in
the X.Org stack without people noticing. They're special in that they have
absolute x/y axes but relative wheels. For libinput that's not as much of a
problem as it is in X but let's add them anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-11 09:55:42 +10:00