Commit graph

1314 commits

Author SHA1 Message Date
Peter Hutterer
7860a9ed77 touchpad: stop palm detection when a second finger is detected
This avoids accidental palm detection during two-finger scrolling if one
finger is inside the edge exclusion zone.

Palm detection is designed to avoid accidental touches while typing. If a
non-palm finger is on the touchpad already the user is unlikely to be typing.
So stop palm detection in this case and process the fingers as normal.

This implementation has a minor bug: if both palm touches start within the
palm exclusion zone within the same frame, neither will be labelled as palm
due to how we check the other touches. Since this is an extremeley niche case
we can live with that.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-15 10:23:18 +10:00
Peter Hutterer
4bb0adfc1c touchpad: split palm movement detection into a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-15 10:23:18 +10:00
Peter Hutterer
92b21247f4 touchpad: don't warn about kernel jumps on semi-mt devices
These devices are all over the place anyway, no need to spam the log, just
silently discard the jumps.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-13 08:15:41 +10:00
Peter Hutterer
f71329d0d8 pad: add helper function to access the libinput context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10 06:57:41 +10:00
Peter Hutterer
3824e161ed tablet: add helper function to access the libinput context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10 06:57:41 +10:00
Peter Hutterer
45d23a6b0e evdev: add helper to get the libinput context from the evdev device
And change the various callers, especially those where we only had the
separate struct for indentation purposes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10 06:57:41 +10:00
Peter Hutterer
48d82ed3ea touchpad: use the tp_libinput_context() helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10 06:57:41 +10:00
Peter Hutterer
c781ef2eb3 evdev: check model flags for actual booleans
The hwdb doesn't allow unsetting a property so once we start nesting model
flags it'll become important to be able to be able to unset one as well (by
assigning it to 0).

So rather than checking for existence, check whether the property is actually
set to something resembling a boolean.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-10 06:57:35 +10:00
Peter Hutterer
a914e253fc pad: change button map ordering
BTN_A and above sort after BTN_BASE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-08 17:24:22 +10:00
Peter Hutterer
b90e2e8c43 pad: group the button state into a private struct
This is only set on button events so use the same approach as for rings and
strips. No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-06-08 11:36:45 +10:00
Peter Hutterer
27078b2667 touchpad: restore the hysteresis by default
A large part of the bugs seen right now are related to touchpads jittering too
much. Fixing them one by one is entertaining, but time consuming. Right now
the number of touchpads that require a hysteresis seem to outnumber those that
don't, so switch the approach around: leave the hysteresis in place but
disable it for those touchpads that don't need it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-06 09:00:14 +10:00
Peter Hutterer
faf7a6107f touchpad: warn if we have invalid touchpad ranges
Quite a few bugs are caused by touchpad ranges being out of whack. If we get
input events significantly outside the expected range (5% width/height as
error margin) print a warning to the log.

And add a new doc page to explain what is happening and how to fix it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-02 08:01:43 +10:00
Peter Hutterer
031b7fb79b touchpad: short-circuit the edge scroll handling when it's not enabled
No need to handle events properly in the edge scroll state machine when it's
not enabled. Just set any beginning touch to state AREA and move on. The rest
of the code guarantees neutral state when edge scrolling is enabled or
disabled.

This reduces the debug output produced by libinput-debug-events when edge
scrolling is disabled, preventing users from seemingly identifying
bugs where there are none.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-01 15:31:43 +10:00
Peter Hutterer
cf707baace tablet: up the reference count for the tool in the event
Make sure that the tool is valid while the event is valid, even if the device
gets destroyed before the event is destroyed.

This cannot actually be triggered right now, the event has a ref to the device
and the tools do not get removed until the device is destroyed. But for future
implementations (e.g. where the tool is otherwise automatically destroyed on
proximity out) we need to ensure the tool remains valid for the event
lifetime.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30 16:10:12 +10:00
Peter Hutterer
83b0f3c4f3 touchpad: fix link in error message - add missing '.html'
https://bugs.freedesktop.org/show_bug.cgi?id=96191

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30 16:10:12 +10:00
Peter Hutterer
0933650f66 pad: ignore EV_MSC events
The Wacom Express Key Remote sends the serial number via EV_MSC. At some later
point we'll need the serial to match the LEDs correctly but for now we can
ignore them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-27 13:02:30 +10:00
Peter Hutterer
40e3fe2384 doc: update ref/unref behavior for the tablet tool
Brings it in line with the rest of libinput.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-24 14:40:48 +10:00
Peter Hutterer
c2dfe504ed doc: update doc to explicitly state that the seat isn't referenced
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-24 14:40:44 +10:00
Peter Hutterer
e1915b53b5 Drop the ALPS_RUSHMORE tag
Was only used for the touchpad hysteresis, we can re-use the wobbly touchpad
tag for this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-23 14:56:15 +10:00
Peter Hutterer
5f4f211d6d doc: fix a few typos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-19 17:24:00 +10:00
Peter Hutterer
58f4058cf7 touchpad: disable cursor jump detection for Wacom tablets
We haven't seen jumps on Wacom tablets yet and they cause error messages in
most of the tests. litest uses a scaling approach for most events, so a finger
move that moves from 30% to 80% of the touchpad with can easily trigger a jump
on a Wacom tablet due to its physical size.

Rather than having to fix up all tests for the larger size (and potentially
cover some other bugs) simply disable this test for Wacom tablets.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-19 09:06:36 +10:00
Peter Hutterer
2f5231cc88 touchpad: only use negative pressure change check on Lenovo *50 and *60 series
This was introduced for bug 94379 - an X1 Carbon 3rd. Other touchpads have
different pressure change ranges, causing this condition to trigger
randomly and resulting in a jerky pointer motion.

For now, reduce the check to the *50 and *60 series touchpads until we have
data for more touchpads that we can add one-by-one.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-18 07:35:36 +10:00
Peter Hutterer
8527242ed9 evdev: the range between dpad and trigger-happy are keys, not buttons
Affected keys:
	KEY_ALS_TOGGLE
	KEY_BUTTONCONFIG
	KEY_TASKMANAGER
	KEY_JOURNAL
	KEY_CONTROLPANEL
	KEY_APPSELECT
	KEY_SCREENSAVER
	KEY_VOICECOMMAND
	KEY_BRIGHTNESS_MIN
	KEY_BRIGHTNESS_MAX
	KEY_KBDINPUTASSIST_PREV
	KEY_KBDINPUTASSIST_NEXT
	KEY_KBDINPUTASSIST_PREVGROUP
	KEY_KBDINPUTASSIST_NEXTGROUP
	KEY_KBDINPUTASSIST_ACCEPT
	KEY_KBDINPUTASSIST_CANCEL

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-17 07:58:15 +10:00
Peter Hutterer
1c276f7f4a Merge branch 'wip/trackball-rotation' 2016-05-16 09:22:15 +10:00
Peter Hutterer
d1a8a92184 Add support for relative device rotation (trackball only)
Trackballs are effectively stationary devices and can be positioned at any
rotation. They are also employed by users with impaired dexterity which
sometimes implies that they are positioned at an non-default angle to make the
buttons easier to reach.

Add a config option for rotation for trackball devices. Currently only
supported for 90-degree angles, if there is a need we can add more angles
later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-16 09:21:38 +10:00
Peter Hutterer
98ee1791ca gestures: don't send swipe gestures when gestures are disabled
Introduced in 6ad303b as part of an code flow optimization, causing any 3+
finger gesture to be posted as swipe gesture, even when gestures are disabled.
However, the event is filtered in the higher levels with a bug message printed
to the log.

Don't post swipe gestures for devices where gestures are disabled.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-16 08:18:59 +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
4d2724d022 evdev: de-duplicate the model property->model flag list
Rather than a list where the only difference is the LIBINPUT_MODEL vs
EVDEV_MODEL prefix, use a macro.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-03 17:16:47 +10:00
Peter Hutterer
d8e92b3e45 evdev: log the applied model flags in debug mode
Makes it a lot easier to figure out if the udev properties are set up
correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-03 15:10:01 +10:00
Peter Hutterer
dc7570f047 Constify two matrix multiplication helpers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-03 13:44:04 +10:00
Peter Hutterer
df42e9aebc doc: add an overview of the various configuration options
It's a bit hard to find what can be configured in the wall of text that is the
doxygen output. Add a TOC of the various options so it's easy to get a quick
grasp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-03 09:09:34 +10:00
Peter Hutterer
b94b40206b doc: add missing @ingroup tag to the accel profile enum
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-03 08:50:23 +10:00
Peter Hutterer
6a22eed4ef touchpad: detect and warn about kernel tracking pointer jumps
If a touch moves by more than 20mm within a single frame, reset the motion
history, effectively discarding the movement. This is a relatively common bug
and almost always needs a kernel fix, so add an explanatory page to the docs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-28 10:01:20 +10:00
Peter Hutterer
4fdaa1b2a9 Make a link to the html docs available as a #define
The "latest" documentation link is the location for the master branch,
released versions have their own directory on the server.

The micro-versions of 90 and above are used for snapshots and release
candidates, so whenever we have a micro version of >= 90 we still want to link
to the "latest" documentation. In all other cases, we link to the current
release.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-28 10:01:20 +10:00
Peter Hutterer
4552d686f8 tablet: fix distance normalization range after 25a9f39
25a9f39 changed the range to [-1, 1] but that's incorrect for the distance
values. Split the normalization up into two functions and make sure our
distance range is correct.

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

And while we're at it, sneak in a test for pressure ranges too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-04-28 09:23:27 +10:00
Peter Hutterer
248912f1ef touchpad: exclude Logitech touchpads from disable-while-typing
Logitech does not sell internal touchpads, the closest ones are the TK820 and
the K400 series devices. Neither of which need DWT, the touchpad is next to
the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-22 12:13:26 +10:00
Peter Hutterer
f3170ab724 Fix distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-21 15:21:08 +10:00
Peter Hutterer
064c72a52a Merge branch 'wip/tablet-pad-support' 2016-04-18 13:31:46 +10:00
Peter Hutterer
83771f1b17 fixup! Add the LIBINPUT_DEVICE_CAP_TABLET_PAD capability and matching interface 2016-04-18 13:23:39 +10:00
Peter Hutterer
8e17a9ab5c pad: implement wacom pad support
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
b2a3706948 Add the LIBINPUT_DEVICE_CAP_TABLET_PAD capability and matching interface
This interface handles the buttons on the physical tablet itself, including
the touch ring and the strip.

A notable difference to other libinput interfaces here is that we do not use
linux/input.h event codes for buttons. Instead, the buttons are merely
numbered sequentially, starting at button 1. This means:
* the API is different, instead of get_button() we have get_button_number() to
  drive the point home
* there is no seat button count. pads are inherently different devices and
  compositors should treat them as such. The seat button count makes sense
  when you want to know how many devices have BTN_LEFT down, but it makes no
  sense for buttons where all the semantics are handled by the compositor
  anyway.

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
61e58a4c1f tablet: move the libwacom check for left-handed-ness into a helper function
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:11:59 +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
b31618b25b evdev: use a slot variable instead of dereferencing everywhere
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
ef4e96de58 evdev: rename slot to slot_idx
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-04-18 08:40:41 +10:00
Peter Hutterer
df879a6c4f evdev: move the hysteresis code to a more generic location
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-04-18 08:40:41 +10:00
Peter Hutterer
afdcaf5015 touchpad: add LIBINPUT_MODEL_WOBBLY_TOUCHPAD for the HP 14-ac157tu
If some elantech touchpads require a hysteresis, let's use some more generic
tag for those touchpads that require correct handling of pointer wobbles.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-15 10:46:54 +10:00
Peter Frühberger
f00b5d609c touchpad: enlarge top button area by a factor 3 instead of 1.5
When the touchpad is disabled, the top software button on the Lenovo T440
series touchpads currently enlarge by a factor of 1.5 (to 15mm). This is not
enough, a user has to rotate the wrist quite uncomfortable when using
the left mouse button.

When the touchpad itself is off anyway we can extend the size of the top
software buttons to the factor 3, i.e. 30mm.

Signed-off-by: Peter Frühberger <peter.fruehberger@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-15 10:33:48 +10:00
Peter Hutterer
c61dfc80bd evdev: enable middle-button scrolling on middle-button emulation
https://bugs.freedesktop.org/show_bug.cgi?id=94856

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-14 10:48:26 +10:00
Peter Hutterer
aeb0c21b1c evdev: split scroll button state check out
Rather than checking the physical key's state, set a flag for the button to be
down. This enables us to use non-physical buttons (middle button emulation).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-04-14 10:48:21 +10:00