Commit graph

1925 commits

Author SHA1 Message Date
Peter Hutterer
79139ebcd1 touchpad: move the tapping exclusion zone to the top edge of the button
We previously used the half-way mark of the touchpad's y axis to decide where
to ignore tapping. Move this down to the top edge of the software buttons
instead. Users may tap with a finger in the software button areas, on the rest
of the touchpad it's unlikely that they tap within 5% of the edge.

On touchpads with physical buttons or if clickfinger is enabled, the
no-tapping zone extends to the bottom of the touchpad. This required splitting
the tests into clickfinger, softbuttons and hardbuttons.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-18 10:38:20 +10:00
Peter Hutterer
d6b889852a touchpad: add synaptics semi-mt devices to those needing hysteresis
https://bugs.freedesktop.org/show_bug.cgi?id=94097

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-18 09:56:00 +10:00
Peter Hutterer
cc0c3e8598 configure.ac: libinput 1.2rc2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-15 17:13:01 +10:00
Peter Hutterer
3d1b17e1fd test: add tablet test for out-of-bounds motion coordinates
The newer Cintiqs have a minimum value of 400/400 advertised by the kernel but
the actual sensor goes past the 0/0 origin. Test this, make sure that a value
outside the boundaries generates negative mm values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-11 16:03:13 +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
9356d9b97d doc: update tablet svg to show tilt as angle
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 15:06:12 +10:00
Peter Hutterer
0c0832d06c test: add a simple test to guard against wrong library version changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 15:03:25 +10:00
Peter Hutterer
c6a082dfd9 tablet: move left-handed initialization into tablet_init
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 13:57:10 +10:00
Peter Hutterer
61c4ed9d7a Indentation fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 13:54:04 +10:00
Peter Hutterer
4bf8365a02 tablet: fix artpen rotation on left-handed tablets
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:05:16 +10:00
Peter Hutterer
6bd2a4a5f1 test: add test for left-handed mouse rotation on tablets
Should be offset by 180 degrees

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:05:16 +10:00
Peter Hutterer
d8eced2afe tablet: move clearing the tilt bits up to where we reset the axes
No functional change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:05:16 +10:00
Peter Hutterer
ebe02cb19e tablet: delay initial proximity in event until we have a serial
If the tablet is already in proximity on startup, we used to immediately sent
a proximity event. We can't fetch MSC_SERIAL from the kernel, so that tool
always had a serial of 0, followed by events with the real serial. Since
clients are supposed to use the serial for the tracking of tools, this is
suboptimal.

When the tablet is added, merely set the internal proximity flags. This way we
wait until the first real event from the device (which includes the serial
number) and convert that into a proximity event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:02:08 +10:00
Peter Hutterer
07420eec05 touchpad: init a default hysteresis for ALPS rushmore touchpads
https://bugs.freedesktop.org/show_bug.cgi?id=90590

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-10 08:08:31 +10:00
Peter Hutterer
1f304763b4 udev: fix ALPS firmware detection
The firmware version is in id.version, not id.model which is always
PSMOUSE_ALPS for ALPS devices.

The various fw versions are listed in <kernel>/drivers/input/mouse/alps.h and
are all hex numbers. Version 8 is actually 0x800, change the match
accordingly.

Expected side-effect: earlier versions of ALPS touchpads now lose their
(erroneous) size assignment.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 08:08:31 +10:00
Peter Hutterer
c9abcb2e1c tablet: change tilt axes to use degrees
The Wacom tilt range is 64 degrees so we map everything into that until we
know otherwise.

This commit also switches the tilt axes around to align the angles with the
x/y orientation, i.e. tilting the top of the stylus towards the positive x
axis now generates a positive x tilt.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-02-09 12:19:12 +10:00
Peter Hutterer
0e87dc9af2 touchpad: fix dwt disabling while a key is still down
If dwt is disabled on the commandline, e.g. by setting an xinput property it
may be disabled before the release event comes in. This caused the timer to
refresh indefinitely since the key state mask was still on for that key.
Always updating the key state mask (even when dwt is disabled) fixes that.

If a key is held down while dwt is disabled, this can still cause a indefinite
timer refresh, so in the timer func, check if dwt is enabled before refreshing
the timer.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-09 07:40:04 +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
cbf775ba3d tools: fix output to say TABLET_TOOL instead of just tablet
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:34:25 +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
b27f04689e touchpad: while a key is held down, don't disable dwt
If a key enables dwt and is held down when the timeout expires, re-issue the
timeout.

There is a corner case where dwt may not work as expected:
1. key down and held down
2. dwt timer expires, dwt is re-issued
3. touch starts
4. key is released
5. dwt timer expires
6. touch now starts moving the pointer

This is an effect of the smart touch detection. A touch starting after the
last key press is released for pointer motion once dwt turns off again. This
is what happens in the above case, the dwt timer expiring is the last virtual
key press. This is a corner case and likely hard to trigger by a real user.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-05 07:40:51 +10:00
Peter Hutterer
a84bf167a3 test: fix leaking libevdev fd
This was the reason for the valgrind test case failures whenever we
accumulated too many tests (see 9c2afae1 and 2a110104). The cause was simply
that we ran out of fds which caused libevdev to fail the scandir() searching
for the event node. That resulted in a NULL devnode and an abort in litest.

Close the fd before freeing the evdev device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 07:40:50 +10:00
Peter Hutterer
57527623ee test: fix the udev rule for the synaptics hover device
Missing \\ for a udev rule split across two lines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 16:26:29 +10:00
Peter Hutterer
f6c2d4b8b5 touchpad: drop motion hysteresis by default
Some older touchpad devices jitter a fair bit when a finger is resting on the
touchpad. That's why the hysteresis was introduced in the synaptics driver
back in 2011. However, the default value of the hysteresis in the synaptics
driver ended up being 0, even though the code looks like it's using a fraction
of the touchpad diagonal. When the hysteresis code was ported to libinput it
was eventually set to 0.5mm.

Turns out this is still too high and tiny finger motions are either
nonreactive or quite jumpy, making it hard to select small targets. Drop the
default hysteresis by reducing its margin to 0, but leave it in place for
those devices where we need them (e.g. the cyapa touchpads).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-04 15:12:55 +10:00
Peter Hutterer
c352a50295 test: exclude semi-mt devices from the normal 2fg scroll test
We have a specific semi-mt 2fg scroll test for those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 15:12:55 +10:00
Peter Hutterer
bcbe579e1c test: check for BTN_TOOL_QUADTAP in the 4fg btntool tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 13:50:49 +10:00
Peter Hutterer
7b21026e3a test: fix printfs to say "TABLET TOOL" instead of "TABLET"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 08:00:06 +10:00
Peter Hutterer
e086f9cf92 tablet: change error message to TABLET_TOOL from TABLET
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 07:59:07 +10:00
Peter Hutterer
87d60276f3 doc: be more specific about tablet vs tablet tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 07:58:39 +10:00
Peter Hutterer
3bea95c851 doc: add the tablet support page to the related pages hierarchy
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-02 13:55:01 +10:00
Peter Hutterer
d76dc643cd test: fix call to test_2fg_scroll
Last argument is a boolean whether we want to have a tap timeout. It used to
be the ms to sleep, obsolete since e4adbff919

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-01 12:14:09 +10:00
Peter Hutterer
e808b47b82 test: add two gesture tests for scrolling with a thumb in the btnarea
If a finger is resting in the software button area, it must not be counted
towards the gesture. So a two-finger movement must be a scroll event, not a
three-finger pinch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-01 08:38:23 +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
7381ea7a5c tools: split drawing commands into helper functions
Makes the draw() call a bit easier to read

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-29 16:06:29 +10:00
Peter Hutterer
9d7f97390d tools: draw the pointer sprite last
Don't hide it behind other things

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-28 16:31:22 +10:00
Peter Hutterer
19e1a0bb6f configure.ac: libinput 1.2rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-28 11:51:48 +10:00
Peter Hutterer
4b4172a8e6 Merge branch 'tablet-support' 2016-01-27 16:02:47 +10:00
Peter Hutterer
62a0097d96 Prepare tablet-support branch for merging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-27 15:38:47 +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
f8bcbc2dbb gestures: average motion by active touches, not moved touches
When two fingers move slowly, an event frame may only have one finger motion,
followed by a frame with the other finger's motion. If we only divide by the
number of dirty touches, the speed of the gesture increases whenever that
happens.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-27 09:51:05 +10:00
Peter Hutterer
de3f1fa6fa Merge branch 'master' into tablet-support 2016-01-25 15:29:11 +10:00
Peter Hutterer
b6f59d0e3b gestures: average motion by active touches, not moved touches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 12:51:29 +10:00
Peter Hutterer
6ad303b3d3 gestures: jump straight to swipe for 3+ finger gestures on ST touchpads
The first/second variables are only needed for pinch, so we can skip them
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-25 11:31:37 +10:00
Peter Hutterer
71fcd387f7 gestures: jump straight to swipe for 3+ finger gestures on ST touchpads
The first/second variables are only needed for pinch, so we can skip them
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 11:31:37 +10:00
Peter Hutterer
05bec98681 touchpad: remove unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 11:31:37 +10:00
Peter Hutterer
f0fa09c73f Merge branch 'wip/disable-semi-mt-gestures'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 11:31:35 +10:00
Peter Hutterer
25ab3d4615 touchpad: remove unused field multitap_last_time
Unused since d92ae62dad

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 08:28:43 +10:00
Peter Hutterer
6920a42fd4 tablet: fix potential null-pointer dereference
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22 18:08:44 +10:00
Peter Hutterer
a6b43386d6 test: fix uninitialized variable
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22 18:06:01 +10:00