Commit graph

2103 commits

Author SHA1 Message Date
Peter Hutterer
d20bbfa5cb tablet: handle a direct tool switch correctly
Fixes #259

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-31 23:27:39 +00:00
Peter Hutterer
bc461b0292 tablet: add a helper function to get the current tool
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-31 23:27:39 +00:00
Peter Hutterer
727a504e0d fallback: fix a coverity warning
Value stored to 'rect' during its initialization is never read

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-24 14:10:47 +10:00
Peter Hutterer
61f81ec93e meson: move HTTP doc url generation to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-17 08:31:28 +00:00
Peter Hutterer
63f9923013 Add a scroll button lock feature
Scroll button locking is an accessibility feature. When enabled, the scroll
button does not need to be held down, the first click holds it logically down,
to be released on the second click of that same button.

This is implemented as simple event filter, so we still get the same behavior
from the emulated logical button, i.e. a physical double click results in a
single logical click of that button provided no scrolling was triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-17 12:21:41 +10:00
Peter Hutterer
f392766155 fallback: don't send a single-touch motion if we just sent a begin
Any touch down event will also provide motion data, but we must not send a
motion event for those in the same frame as the down event.

Fixes #375

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-16 03:43:45 +00:00
Peter Hutterer
2b33445bc9 touchpad: use the same speed for scrolling as the baseline of the accel curve
Scrolling and gestures use unaccelerated motion. The idea behind it was that
at least for the default speed setting of 0, the accelerated speed and
unaccelerated speed are identical where meaningful.

The touchpad speed curve has a plateau for 'normal' speeds (i.e. not very slow
and not very fast) where the acceleration factor is constant. This is the
reference factor that the unaccelerated motion should use as well.

Since the touchpad acceleration rework in d6e5313497 the reference factor is
0.9 * TP_MAGIC_SLOWDOWN (previously the factor was 1.0 * TP_MAGIC_SLOWDOWN)
and scroll motion is thus 10% faster than the pointer movement at the default
speeds. Let's fix this and let the two match up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-14 02:57:48 +00:00
Aleix Pol
c20d08ac23 LIBINPUT_EVENT_TABLET_BUTTON doesn't exist, use LIBINPUT_EVENT_TABLET_PAD_BUTTON 2019-10-11 02:37:39 +02:00
Peter Hutterer
f37a712ca2 util-time: include linux/input.h
struct timeval isn't defined in time.h, at least not on musl. And since we
need that value for struct input_events, let's include the header for that
struct. That'll sort out the includes for free.

Fixes #371

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-05 07:14:25 +10:00
Jakub Schmidtke
8490384c68 Fixed horizontal scrolling on Logitech MX Master 2S/3
Logitech MX Master 2S and 3 by default use natural scrolling
for the horizontal scroll wheel, while the main wheel
uses traditional mode. This change inverts the default
direction of horizontal scrolling.
2019-09-30 23:34:45 +00:00
John Chadwick
8568cf1b3a tablet: Improve forced prox out behavior.
Some graphics tablets (most or all Wacom, for example) do not emit
proximity out events when the tablet pen goes out of range. To
compensate for this, libinput synthesizes proximity out events when no
events are received for a certain period of time. Unfortunately, on some
tablets, this is fairly failure prone when moving the pen slowly. As a
workaround, this patch causes libinput to avoid synthesizing proximity
out events when the pen is still in contact with the tablet pad, as
defined by the TABLET_TOOL_IN_CONTACT status.
2019-09-29 23:35:09 +00:00
Peter Hutterer
a5c6571ed0 middle-button: add space to middlebutton state debug message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>`
2019-09-27 17:24:33 +10:00
Peter Hutterer
b38722317c doc: update reference to the event codes header
The codes have been in input-event-codes.h for quite a few releases now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-25 15:16:45 +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
Peter Hutterer
129a1dffa4 gestures: rename the inner/outer thresholds to min/max_move
inner/outer refer more to static thresholds when really what we have here is a
minimum movement before we look at the touch, and a maximum one after which
it's largely ignored.

Straight-up rename, no functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-25 04:10:02 +00:00
Peter Hutterer
0ce06d1314 touchpad: only identify for pinch in a distinct pinch position
Previously, any lower finger spaced more than the vertical threshold apart
would be labelled as thumb. This causes some taps to be detected as
single-taps, particularly where the user's hand is at an angle that causes the
touches to be effectively vertical.

Restructure that condition so that we only go for a thumb if we're
distinctively apart, and we only *not* go for thumb if we're distinctively
close together.

Fixes #359

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-25 04:10:02 +00:00
Peter Hutterer
d4ede2256c touchpad: drop useless asserts()
Just above that line is an early return if either is NULL, so...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-25 04:10:02 +00:00
Serhii Chaplia
79e91f8a30 Touchpad fix and trackpoint speed adjustment for Lenovo T490s
Same issue as #177
2019-09-25 00:46:23 +00:00
Konstantin Kharlamov
18d526bc75 quirks.c: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-13 00:07:39 +03:00
Konstantin Kharlamov
6a14c13088 udev-seat.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-13 00:07:39 +03:00
Konstantin Kharlamov
fe5bc0df4f path-seat.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-13 00:07:39 +03:00
Konstantin Kharlamov
ed698fbab5 evdev-mt-touchpad-buttons.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-13 00:07:39 +03:00
Konstantin Kharlamov
fae8b9e14a filter.h/c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-13 00:07:39 +03:00
Konstantin Kharlamov
25f7d85bb3 timer.c: remove unused include <inttypes.h>
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
dec003e6bd evdev-tablet-pad-leds.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
8f278e69c2 evdev-tablet.c: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
c29fabb2cf evdev-mt-touchpad-gestures.c: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
cad74b7451 evdev-mt-touchpad-edge-scroll.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
b825b0f1af evdev-mt-touchpad-tap.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
48366f4aab evdev-mt-touchpad.h: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
27324e006f evdev.c: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
4b219c03ac filter-trackpoint.c: remove unused include
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
0ae4032e85 filter-touchpad-x230.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
23f7a2647d filter-touchpad.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
832c59855d filter-mouse.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
22c044c1dd filter-low-dpi.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Konstantin Kharlamov
a3857b4bec filter-flat.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
Peter Hutterer
e7a9c07ffe udev: parse the EVDEV_ABS properties for a potential fuzz setting
Where a fuzz is defined in the 60-evdev.hwdb, we rely on a udev builtin to
set the kernel device to that fuzz value. Unfortunately that happens after our
program is called with this order of events:
1. 60-evdev.rules calls IMPORT(builtin) for the hwdb which sets the EVDEV_ABS_*
  properties. It also sets RUN{builtin}=keyboard but that's not invoked yet.
2. 90-libinput-fuzz-override.rules calls IMPORT{program} for our fuzz override
  bits. That sets the kernel fuzz value to 0 and sets the LIBINPUT_FUZZ_*
  propertie
3. The keyboard builtin is run once all the rules have been processed.

Our problem is that where the fuzz is set in a hwdb entry, the kernel fuzz is
still unset when we get to look at it, so we always end up with a fuzz of zero
for us and a nonzero kernel fuzz.

Work around this by checking the EVDEV_ABS property, extracting the fuzz from
there and re-printing that property without the fuzz. This way we ensure the
kernel remains at zero fuzz and we use the one from the hwdb instead.

Fixes #346

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:24:02 +10:00
Peter Hutterer
1e6802b91b Remove some usage of libinput-util.h
Positive side-effect - this exposed a bunch of missing #includes that got
pulled in by other headers before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:23:06 +10:00
Peter Hutterer
c84366e85e Split utility functions into separate source files
libinput-util.h is getting a bit of a catchall bucket and it includes things
like libinput-private.h which in turn includes libwacom. This makes
libinput-util.h less useful for bits that only need e.g. the string processing
utilities.

So let's split them all up in to separate files, to be used as-needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:23:04 +10:00
Matt Mayfield
73d55cc6c5 touchpad: don't allow gestures with a clickpad button down by a finger
Allowing gestures when holding a physical click enables tasks like
switching workspaces while dragging an icon, but this should only be
possible with a *thumb* holding down the clickpad, not fingers. This
commit restores the ability to hold down the clickpad with two or three
fingers to right- or middle-drag.

Fixes #339, #340

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-16 14:48:52 +10:00
Peter Hutterer
d93feba134 tablet: scale the available pressure range into the pressure thresholds
Pens that don't have a pressure offset (caused by a worn-out tip) still have
basic pressure thresholds to avoid tip events when we're still a bit away from
the tablet or barely touching it. That range is currently 5% of the pressure
for tip down, 1% for tip up.

This leaves us with 95% of the range and that needs to be scaled correctly,
otherwise the bottom 5% happen before a tip event and are inaccessible where
applications don't look at pressure before tip down.

Fixes #332

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
72121d6f6c tablet: reduce the pressure range by the offset
Previously, the pressure range was calculated from the axis total range. A
device with a pressure offset making the bottom 10% inaccessible would lose
10% of that range as non-accessible. Due to the implementation, this affected
the upper range of the device, so the top N percent became unaccessible. Which
may be why no-one's noticed this yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
f97e361d5d tablet: make the pressure-offset inclusive of the axis minimum
The offset handling was inconsistent, stored as relative to the axis minimum
but used as absolute in some places. Fix this by always using the absolute
value including the minimum (i.e. no pressure offset means offset == minimum).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 13:58:54 +10:00
Peter Hutterer
a71d091e59 tablet: add a comment explaining why we adjust the pressure offset downwards
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 12:54:52 +10:00
Peter Hutterer
c5865f3ef0 tablet: point the pressure offset log messages to the right URL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-08 12:54:52 +10:00
Brian Ashworth
801485afda evdev: always store user calibration matrix
In evdev_device_calibrate, the user matrix was not being stored when it
was the identity matrix. This resulted in
libinput_device_config_calibration_get_matrix not providing the correct
matrix. Instead of giving the identity matrix, the last non-identity
matrix set was given.

This just moves the storage of the user matrix in
evdev_device_calibrate to be above the identity matrix early return so
that it always get stored.

Signed-off-by: Brian Ashworth <bosrsf04@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-05 09:58:06 +10:00
Matt Mayfield
c284d4aaf0 touchpad: stricter thumb detection if no pressure/size 2019-07-17 09:33:14 +10:00
Matt Mayfield
35fd6e6c4e touchpad: don't detect speed-based thumbs if there's already a thumb 2019-07-17 09:33:14 +10:00
Matt Mayfield
4536b5b38f touchpad: revamp thumb detection
Instead of a simple yes/no/maybe for thumbs, have a more extensive state
machine that keeps track of the thumb. Since we only support one thumb anyway,
the tracking moves to the tp_dispatch struct.

Test case changes:
touchpad_clickfinger_3fg_tool_position:
  with better thumb detection we can now handle this properly and expect a
  right button (2fg) press for the test case
touchpad_thumb_no_doublethumb_with_timeout:
  two thumbs are now always two fingers, so let's switch to axis events here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-17 09:33:14 +10:00