Commit graph

166 commits

Author SHA1 Message Date
Peter Hutterer
d0cd796095 touchpad: mark the Apple onebutton touchpad as clickfinger-default
We don't initialize click methods on devices with physical buttons. This model
is a special case, it's not a clickpad but it only has one button (because one
button is all you ever need and whatnot).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f2f616a1fc)
2017-02-17 15:38:54 +10:00
Peter Hutterer
a294cf4f90 test: add a synaptics RMI4 test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 14:45:50 +10:00
Peter Hutterer
91467f7280 test: add test for the vertical position-dependent pinch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-22 07:26:55 +10:00
Peter Hutterer
0a82d2fa39 touchpad: if an external touchpad and keyboard share a VID/PID assume dwt
This requires to expand the blacklisting to be a bit more specific so we don't
initialize dwt config on devices that won't need it.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-20 10:21:43 +10:00
Peter Hutterer
5d2501aa7d Drop HAVE_CONFIG_H ifdef
We have one. Yay. Lucky us. Go forth and celebrate.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-12-01 11:06:54 +10:00
Peter Hutterer
31542ffbfd test: add a device and test for udev-set calibration values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-11-29 11:21:38 +10:00
Peter Hutterer
58c7a9cbf0 evdev: implement support for the MOUSE_WHEEL_CLICK_COUNT property
Not all mice have a click angle with integer degrees. The new
MOUSE_WHEEL_CLICK_COUNT property specifies how many clicks per full rotation,
the angle can be calculated from that.

See https://github.com/systemd/systemd/pull/4440 for more information

CLICK_COUNT overrides CLICK_ANGLE, so we check for the former first and then
fall back to the angle if need be. No changes to the user-facing API.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-04 12:10:52 +10:00
Peter Hutterer
38a562e485 test: rename SYNAPTICS_CLICKPAD to SYNAPTICS_CLICKPAD_X220
That's where this device comes from. The x220 is special because it's too
small to trigger some of the features, eg. palm detection. Make this more
obvious by changing to a less generic name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-09 12:54:01 +10:00
Peter Hutterer
31fdb7e6b0 test: add litest_assert_touch_sequence helper
Touch sequences are interrupted by TOUCH_FRAME events which makes them
annoying to handle event-by-event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-09-07 11:17:03 +10:00
Peter Hutterer
df781aad2f test: add trackpoint palm detection tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-07 09:20:15 +10:00
Peter Hutterer
9550cd47b2 test: add a Wacom HID 4800 test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-09-02 09:10:54 +10:00
Peter Hutterer
a43042425e test: add a helper function to compare the event type
New error message prints the human-readable event type, not just the enum
values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-26 14:12:44 +10:00
Peter Hutterer
ff1347727e test: implement tests for configurable tap button mappings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:09:38 +10:00
Peter Hutterer
a7f04c9a84 test: only init the device rules once
The udev hwdb takes about 200ms and we still trigger it on each device. The
udev rules don't actually change after compiling, so simply create them
once and remove them after the test run.

For multiple test binaries this needed to be synchronized (which is hard),
hence the previous merge into a single binary for all tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
35b28b1af3 test: merge all tests into a single binary
Call it a libinput-test-suite-runner, in subsequent patches we'll handle doing
parallel tests ourselves instead of relying on automake features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-02 10:19:38 +10:00
Peter Hutterer
e06701201f test: add a Cintiq 13 HDT test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-12 15:14:30 +10:00
Peter Hutterer
35a6ebc536 Merge branch 'wip/tablet-pad-modes-v3' 2016-07-04 10:26:03 +10:00
Peter Hutterer
0526044f6d touchpad: remove software middle button when emulation is enabled
Expose the middle button emulation on software buttons as proper config
option. When enabled, remove the middle button software button area.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-04 09:41:33 +10:00
Peter Hutterer
30bc86f47e test: add pad mode group tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-24 13:29:18 +10:00
Peter Hutterer
d520c5bb84 test: add an Wacom EKR test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-24 13:29:18 +10:00
Peter Hutterer
28f75d9f9d Merge branch 'wip/touchpad-drop-hysteresis' 2016-06-20 09:26:44 +10:00
Peter Hutterer
89747d7143 Revert "touchpad: reset the motion history on significant negative pressure changes"
We will reinstate the hysteresis for all devices making the negative
pressure check unncessary.

This reverts commit ef48c07a96.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:23:51 +10:00
Peter Hutterer
9bb0cfd878 test: add an apple magicmouse device
This device has a touchpad on the mouse but it's labeled as mouse. For litest
we only label it as LITEST_MOUSE feature and test the touchpad directly on the
device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20 09:17:38 +10:00
Peter Hutterer
fb5a97211b test: add a keyboard test device with all codes enabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-17 07:58:15 +10:00
Peter Hutterer
8a415e486a Add tagging of trackballs
Currently unused, but oh, the possibilities...

The only thing we have to go on for trackballs at the moment is whether they
have "Trackball" in the name string. All others need to be manually tagged.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-03 17:17:28 +10:00
Peter Hutterer
9ebcc45345 test: drop the hand-enumerated device values
C guarantees that an enum value is previous value+1, so we might as well start
at -1000 and not have to worry about the actual values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-18 13:45:47 +10:00
Peter Hutterer
064c72a52a Merge branch 'wip/tablet-pad-support' 2016-04-18 13:31:46 +10:00
Peter Hutterer
d82cfa1d53 test: tablet pad tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-04-18 09:12:02 +10:00
Peter Hutterer
fcc9a2bf18 evdev: always defuzz absolute touchscreens
If a touchscreen has a fuzz value use it for motion hysteresis similar to how
we do it for a touchpad. This stops pointer wobbles as seen in
https://bugs.freedesktop.org/show_bug.cgi?id=94918

It's up to the system to override or set the kernel's fuzz value correctly,
i.e. a udev hwdb entry is required where the kernel driver does not set it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-04-18 08:40:42 +10:00
Peter Hutterer
aa90121125 touchpad: reset the motion history on significant negative pressure changes
Resetting the motion history has the side-effect of swallowing movements, we
don't calculate deltas until we have 4 motion events. During a finger release,
we're likely to get a large pressure change between two events, resetting the
motion history prevents the cursor from jumping on release.

The value of 7 found by trial-and-error, tested on the T440 and T450 hardware.
The absolute value is highly variable but recordings show that the pressure
changes only by 1 or 2 units during normal interaction. Higher pressure
changes are during finger position changes but since those should not cause a
jump anyway, we tend to win there too.

Currently only enabled for negative pressure changes, let's see how we go with
that.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-03-30 14:07:26 +10:00
Peter Hutterer
197bad1676 test: add Wacom Cintiq 24HD Pen
One test now gets close enough to 100% of the axis value that
ck_assert_double_lt() is not fine-grained enough. Switch to a direct x < 100.0
check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-11 16:02:22 +10:00
Peter Hutterer
4392cb5796 Indentation fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:39:58 +10:00
Peter Hutterer
0b0150e08d touchpad: if we have a serio keyboard, override any previous dwt pairing
If a USB keyboard like the YubiKey is found before the internal keyboard, it
will be paired with the touchpad when it is seen. The internal keyboard is
seen later bug ignored because we already have a keyboard paired with the
touchpad.

This is obviously wrong. For now, give priority to serio keyboards, and
override existing dwt pairings with the new keyboard.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-05 07:43:25 +10:00
Peter Hutterer
e19d5d228c evdev: disable the mode button on the Cyborg RAT 5
This button sends a release N, press N+1 on each press, cycling through the
three event codes supported. This causes a stuck button since the current mode
is never released.

Long-term this better served by a set of switches that toggle accordingly, for
now disable the button codes.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-01 08:37:41 +10:00
Peter Hutterer
ae41aa146d Merge branch 'master' into tablet-support 2016-01-27 13:54:00 +10:00
Peter Hutterer
cba2278c3a touchpad: add a config option to disable tap-and-drag
There are a number of use-cases where tapping may be desirable, but
tap-and-drag is not, e.g. where tapping is used to select multiple items in a
list. Having tap-and-drag on hinders this, and the nature of the interaction
means it cannot be detected based on timeouts, movement thresholds, etc.

Provide an option instead to turn tap-an-drag off. Tap-and-drag remains
enabled by default (though tapping is disabled by default).

For the touchpad tap state diagram, the new option disables the transition
from state TOUCH to state TAPPED and releases the button immediately instead.
This means that multitap-and-drag is disabled too since we now just loop
around in the single-tap state for multitap.

It also makes tapping more responsive - we don't have to wait for the timeout
before we know whether it's a tap event. The first touch time is noted, we now
send the button press with the time of the first touch and the release with
the time of the release. This ensures a realistic time diff between the two
events.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.netto>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-27 10:03:28 +10:00
Peter Hutterer
de3f1fa6fa Merge branch 'master' into tablet-support 2016-01-25 15:29:11 +10:00
Peter Hutterer
342bc51016 touchpad: disable MT for all semi-mt devices
Synaptics, Elantech and Alps semi-mt devices all have issues with reporting
correct MT data, even the bounding box which semi-mt devices are supposed to
report is wrong.

Synaptics devices have massive jumps with two fingers down. Elantech devices
may open slots without coordinate data. Alps devices may send 0/0 coordinates
as initial slot position.

All these may be addressable with specific quirks, but the actual benefit is
largely restricted to better palm detection (though even with quirks this is
unlikely to work) and support for pinch gestures (again, lack of coordinates
makes supporting those hard anyway).

Elantech: https://bugs.freedesktop.org/show_bug.cgi?id=93583
Alps: https://bugzilla.redhat.com/show_bug.cgi?id=1295073

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-22 11:50:45 +10:00
Peter Hutterer
91a568d1a1 Merge branch 'master' into tablet-support 2016-01-19 12:02:51 +10:00
Peter Hutterer
988cfda42c evdev: only reject devices with missing MT x/y if they're MT devices
A fake MT device may have ABS_MT_POSITION_X but not Y. In this case we don't
care, because we don't handle those axes anyway.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-12 09:07:36 +10:00
Caibin Chen
b3f11180e3 touchpad: fix DWT pairing for Macbook Pro 2015
Label internal keyboards through the udev hwdb and only pair the internal
(usb) Apple touchpads with those keyboards labelled as such.

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

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-11 10:11:32 +10:00
Peter Hutterer
2f481ba4a2 tablet: handle custom proximity handling
For the puck/lens cursor tool we need to artificially reduce proximity
detection. These tools are usually used in a relative mode (i.e. like a mouse)
and thus require lifting and resetting the tool multiple times to move across
the screen. The tablets' distance detection goes too far, requiring the user
to lift the device several cm on every move. This is uncomfortable.

Introduce an artificial distance threshold for the devices with the default
value taken from the X.Org wacom driver. If a tool is in proximity but outside
of this range, fake proximity events accordingly.

If a button was pressed while we were out of range we discard that event and
send it later when we enter proximity again.

This is the simple implementation that only takes one proximity out value (the
one from the wacom driver) and applies it to all. Those devices that support a
button/lens tool and have a different default threshold are well out of date.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

[rebased, tests updated for new axis percentage behavior (8d76734f)]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-23 09:15:36 +10:00
Peter Hutterer
aaac47d442 test: add litest_axis_set_value helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-23 07:33:11 +10:00
Peter Hutterer
beee8403e9 test: move litest_assert_ macros and helpers up to the rest of the defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-21 10:55:36 +10:00
Peter Hutterer
aaea4a63ec tablet: add tilt tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-21 09:47:31 +10:00
Peter Hutterer
727d184230 test: change extra axes to take a percentage as well
And change them to doubles, we need more granularity when the range is only
0-100.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-14 07:44:57 +10:00
Peter Hutterer
7ea1c134e6 test: add the HUION PenTablet device
Tablet with pressure and proximity but no distance axis.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-11 10:53:06 +10:00
Stephen Chandler Paul
33981394aa test: Add litest_assert_double_*() macros
Converts two doubles to 24.8 fixed-width integers so assertions can be made with
doubles in tests

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9d96286a44)
2015-12-10 17:00:04 +10:00
Peter Hutterer
5074b59241 Merge branch 'master' into tablet-support 2015-11-24 15:18:47 +10:00
Peter Hutterer
a10e92849c tablet: rename libinput_event_tablet to libinput_event_tablet_tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18 12:13:54 +10:00