Commit graph

5788 commits

Author SHA1 Message Date
David Santamaría Rogado
6f79797308 test: recover external usb keyboard touchpad combo
This recovers the testing that a USB keyboard plus touchpad combo both
set as external, only its own keyboard should affect to DWT that was
removed when Acer Hawaii combo was set as internal.

This is uncommon as usb touchpads nowadays are set as internal, but,
perhaps someone that adds a quirk for a really external combo also adds
in udev's hwdb the external integration for the touchpad, or perhaps we
should set the integration to external when AttrTPKComboLayout=below is
used for the touchpad.

The issue is if the touchpad is leave as internal every keyboard affect
DWT, not only the one that belongs to its combo.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1415>
2026-02-02 09:52:08 +00:00
Michał Chojnowski
b58d5a165b tablet: fix handling of AttrPressureRange quirk
tablet_get_quirked_pressure_thresholds() is wrong:
the pressure thresholds for tip press and tip release are swapped around.
This seems to be a regression introduced in commit 4bc27543e9.

This prevents AttrPressureRange from working as intended for tablets,
and causes weird things to happen if it's set.
(For example, when pressure is in the range between
the intended release threshold and the intended press threshold,
the "pressed" status flip-flops between 0 and 1 every frame).

Fix that.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1420>
2026-02-02 08:41:24 +01:00
Peter Hutterer
fe1d44637f touchpad: add support for fast swipe when 3fg drag is enabled
This adds a movement threshold (5mm) and a timeout (80ms) to the 3fg
drag gesture. On 3fg down with 3fg drag enabled we immediately send a
GESTURE_SWIPE event. After the timeout expires we check the movement of
the fingers - if it is below the threshold cancel the swipe and hold a
button down (i.e. a 3fg drag). Otherwise, continue with this being a
swipe.

This allows for swipe gestures to be used while 3fg drag is enabled.

Above applies the same way for 4fg with 4fg drag enabled.
Thresholds selected using the "yeah, that seems about alright" method,
intentionally quite low because we assume that users that enable 3fg
drag prefer 3fg dragging over swipe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1410>
2026-02-02 06:44:48 +00:00
Peter Hutterer
5b7b8f1bb2 gestures: remove two empty helper functions
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1410>
2026-02-02 06:44:48 +00:00
Peter Hutterer
33b1d87c08 touchpad: don't disable on external mice until we see an event
Instead of disabling the touchpad as soon as a mouse is seen by
libinput, disable it as soon as a mouse sends an actual event. This
works around the current issues with many devices (touchpads and
keyboards alike) announcing a HID Mouse Application Collection which
gets its own event node in the kernel. That event node usually just sits
there and does nothing but its mere presence disabled the touchpad.

Let's change this and instead only disable once we see an event.

Closes: #1104
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1414>
2026-01-28 00:43:37 +00:00
Peter Hutterer
89351c715a test: parametrize the external mouse test
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1414>
2026-01-28 00:43:37 +00:00
Peter Hutterer
e161abdc19 evdev: rename evdev_paired_keyboard to evdev_paired_device
We'll be using this struct for other devices than keyboards.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1414>
2026-01-28 00:43:36 +00:00
David Santamaría Rogado
47482bcd8b quirks: add more specific matches to actual quirks
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1418>
2026-01-27 00:43:51 +00:00
David Santamaría Rogado
307d2509a9 quirks: merge ibm with lenovo
ScrollPoint mouses as well IBM USB Travel Keyboard with Ultra Nav Mouse
are owned by Lenovo.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1419>
2026-01-27 00:19:16 +00:00
Peter Hutterer
86f19a0978 lua: install a timeout hook before any pcalls to prevent infinite loops
If a lua pcall takes longer than one second, kill the plugin.

How often to call the timeout handler is a trade-off but we err on the
side of "possibly too high" since the overwhelmingly vast majority of
plugins will never trigger it anyway.

Gemini suggests that Lua 5.4 can do ~500k ops per second for string
concat (the slowest listed), Claude suggests 1 to 10 million ops per
second. The test in this patch on my 4y old cheap desktop runs the
timeout hook roughly every 37ms. Any normal plugin will be well and
truly done with its work by then.

Closes: #1245
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1416>
2026-01-27 00:02:15 +00:00
Helga K
cc1499fbb3 quirks: Add quirk for Gigabyte Aorus 15BKF keyboard
This keyboard sits on the USB bus, so it's considered an external
keyboard by default. This commit changes that to internal
so that DWT detection on the laptop touchpad works.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1411>
2026-01-22 15:59:42 +04:00
Jens Peters
8854066e93 plugin: add an example for controlling a mouse with a tablet
This plugin controls a mouse/pointer from a tablet device. This
effectively hides stylus interactions and sends pointer events
instead. In other words: mouse emulation for tablets, implemented
by (remote) controlling a mouse device. This allows using a
tablet stylus as a mouse replacement without tablet limitations
from compositors or clients. Note that axis usually needed for
drawing (like pressure, tilt or distance) are no longer emitted
when this plugin is active and a mouse is connected. When no
mouse is connected, this plugin doesn't change tablet events,
thus the stylus works like a normal stylus.

Follow up from https://gitlab.freedesktop.org/libinput/libinput/-/issues/1195

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1412>
2026-01-21 08:44:13 +00:00
Peter Hutterer
074a6f57b8 test: fix some comments for accuracy
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 14:59:02 +10:00
Peter Hutterer
9f096b0403 test: move two helper functions into the only caller
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 14:59:02 +10:00
Peter Hutterer
328b9a8a32 test: fix the gesture hold cancel test
This didn't actually check for the cancellation of the gesture, so let's
add that.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 14:59:02 +10:00
Peter Hutterer
7ff2326efb test: change the gesture state color to normal yellow
The current color is unreadable on my screens and since no-one else
really looks at this much, let's change it for my benefit.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 14:59:02 +10:00
Peter Hutterer
6bca272629 test: parametrize a gesture test
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 14:59:02 +10:00
Peter Hutterer
00e568f43a test: correct a copy/pasted comment
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 13:14:24 +10:00
Peter Hutterer
13405e4b8c test: add missing BTN_TOOL_QUINTTAP to the acer hawaii test device
This recording comes from
https://bugs.freedesktop.org/show_bug.cgi?id=99140 and it's set there so
this si presumably a copy/paste issue.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 11:49:58 +10:00
Peter Hutterer
bee28a7e53 test: remove a leftover etrace()
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1413>
2026-01-20 11:49:58 +10:00
Peter Hutterer
dee2d38476 Add libinput_tablet_tool_get_name() for the tool's specific name
If the tool has a name let's provide that to the caller. We have it
easily accessible so let's export it to make everyone's life easier. The
name is provided by libwacom, there is no need for us
to even copy that value since we don't need it ourselves.

Note that at this point effectively only (some) Wacom devices have
meaningful names. Virtually all non-wacom devices will use a generic
tool and even the built-in Wacoms will largely just say "AES Pen".

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1399>
2026-01-14 16:44:01 +10:00
Peter Hutterer
7d19cb5f40 CI: rebuild to pick up newer libwacom on Fedora 43
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1399>
2026-01-14 09:27:28 +10:00
Peter Hutterer
21ac8568d5 CI: temporarily drop FreeBSD
14.2 is 404 so we cannot rebuild any images and,
14.3 has a bug that blocks it from building images:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292375

So let's disable BSD until the bug is fixed.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1409>
2026-01-13 22:42:07 +00:00
Peter Hutterer
6b4d1905b6 plugin: always disable wheel debouncing on request
The WHEEL_STATE_NONE check was effectively always false:
- if we didn't receive any event yet, wheel_maybe_disable() wasn't
  called in any code path
- if we did receive a scroll event, the wheel state was either
  WHEEL_STATE_SCROLLING or WHEEL_STATE_ACCUMULATING_SCROLL

Fix this two-pronged: remove the check for WHEEL_STATE_NONE but also
immediately call disable when we disable the feature. We don't carry
enough state in this plugin to really worry about the device being in
a fully neutral state (and realistically the vast majority of use-cases
will likely disable wheel debouncing on new device anyway).

Closes #1241

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1408>
2026-01-13 21:52:52 +00:00
Peter Hutterer
005a3e5622 test: remove a leftover etrace()
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1408>
2026-01-13 21:52:52 +00:00
David Santamaría Rogado
2772863af0 quirks: separate logitech quirks
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1407>
2026-01-13 01:50:51 +00:00
David Santamaría Rogado
47312e99d8 quirks: wipe HP Elite x2 G3 keyboard and touchpad
Actually not needed using internal approach.

Keyboard is ps2 wired in pogo pins and touchpad is usb, both internal by
default so dwt is in effect.

If tablet side buttons are also within ps2, they are not going to be
disabled as chassis is detachable.

Tablet mode switch untouched as is unclear if actual kernels play nice
with it.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1406>
2026-01-13 01:53:28 +01:00
David Santamaría Rogado
24ac440ecc quirks: add edit warning where missing
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1405>
2026-01-13 01:00:19 +01:00
David Santamaría Rogado
0110512b3e quirks: huawei better use pn instead pvr
Huawei MateBook X 2020 used M1010 product version but is used within
different Matebook X over the years.

Use EUL-WX9 product name instead.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1403>
2026-01-12 03:49:00 +01:00
David Santamaría Rogado
605abf2f37 quirks: normalize dmi matches
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1403>
2026-01-12 03:49:00 +01:00
David Santamaría Rogado
9a036bec30 test: set usb touchpad as internal
Actually all usb touchpads are internal by default, reflect this in the
acer touchpad definition.

This causes that not only the acer keyboard in its group activates DWT
but all the intenal keyboards.

Remove asserting that other keyboards doesn't affect DWT as that is the
intended behaviour.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1400>
2026-01-10 23:33:41 +01:00
Peter Hutterer
731d4452c3 meson: revamp the debug build detection for the builddir lookup
Ifdef out any special behavior we want so we no longer leak this via
strings in the resulting binary. Ideally we want the compile to fail for
anything missed rather than surprising behavior when we try to access
files in the build directory.

Closes: #1230
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1396>
2026-01-10 10:39:21 +00:00
David Santamaría Rogado
48e367e841 quirks: missing matches
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1402>
2026-01-10 10:23:19 +00:00
David Santamaría Rogado
1e9b81f75d quirks: refactor pixart touchpads
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1401>
2026-01-09 18:46:40 +01:00
David Santamaría Rogado
02b495e790 quirks: internal integration for lenovo detachable
These are quirks needed for Lenovo detachable devices by setting the
keyboard as internal to enable DWT and act as if it's a laptop.

Here we try to cover all the ideapad ones.

Also remove a quirk in Chicony that sets the touchpad below to enable
DWT, prefer to set the keyboard as internal as touchpad position is
intended for external ones like the input device we also move to the
bottom in Lenovo to have all pure input device quirks in one place.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1389>
2026-01-09 02:44:11 +00:00
Peter Hutterer
822a6d9365 tools: make the touchpad-pressure thresholds interactive
Easier to play around with than having to re-start with different
commandline arguments all the time.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1394>
2026-01-09 02:21:13 +00:00
Peter Hutterer
49624ace16 tools: use box-drawing characters for the table in touchpad-pressure
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1394>
2026-01-09 02:21:13 +00:00
Peter Hutterer
82cbbdab78 test: add (a broken) test for a second range config
This tests for a known bug in the implementation rather than the ideal case
how it should work.

The config is applied to the tool and on prox out to the current tablet
but then the tool goes in prox on a new tablet and the configuration
doesn't get applied there. In the test we work around this by injecting
an extra proximity event to get the range applied.

This needs some rework in the evdev-tablet code but it's questionable
whether it makes a difference given the small number of users with
multiple tablets and pressure ranges set.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1397>
2026-01-09 02:01:14 +00:00
Peter Hutterer
47c7bd934a test: fix the multiple-tablet-pressure-range test
The previous test was incomplete, add support for setting pressure
ranges and generally expand and tighten up the test case so it tests
more specficially for the expected events.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1397>
2026-01-09 02:01:14 +00:00
Peter Hutterer
ef1ee837e4 test: allow overriding any axis value
Previously test devices had to set LITEST_AUTO_ASSIGN to be able
to override an axis-specific value. But this prevented us from
easily overriding other axis values (e.g. tablet tool ids) that usually
have the same value.

LITEST_AUTO_ASSIGN should indicate a value that must always be
auto-assigned, that makes a lot more sense.

This does mean we need to handle ABS_MT_TRACKING_ID -1 to avoid that
getting overwritten by auto_assign_tablet_value() but oh well.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
2026-01-09 01:47:13 +00:00
Peter Hutterer
c8e0312195 test: don't assign -1/-1 to x/y on proximity out
This only worked because any all our test devices declare a fixed 0
value for x/y in the proximity out event frame. Since 0 !=
LITEST_AUTO_ASSIGN we never got to the litest_scale() for x/y which
would abort because of the -1 value.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
2026-01-09 01:47:13 +00:00
Peter Hutterer
c9e175a507 test: correct overriding ABS_MISC in litest event frames
This still requires LITEST_AUTO_ASSIGN for that value in the test
devices (which no device currently sets) but meanwhile: not scaling
ABS_MISC into a magic range is the correct thing to do.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
2026-01-09 01:47:12 +00:00
David Santamaría Rogado
d5110e1e68 quirks: acer add detachable keyboards
Cover Acer detachable keyboards used in Switch tablet devices to set
them internal and allow DWT.

Move one of them from chicony using the below method.

While at it change the match for internal keyboard in Acer Spin 5 to
rely of bus and type and add ':' before svn dmi match.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1392>
2026-01-06 22:41:37 +00:00
David Santamaría Rogado
130f95fd43 quirks: rework minisforum keyboard and add one
Use ids for Minisforum V3 and remove dmi match.

Also add Minisforum V3 SE one.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1395>
2026-01-06 13:58:57 +01:00
David Santamaría Rogado
b60416083e quirks: rework tablet mode using chassis type
Don't disable inputs for detachable and tablet devices, they are
physically unplugged from their input devices but tend to have buttons
as internal keyboard in the tablet part that must work always. We know
what kind of device is using the Chassis Type DMI value.

Also remove specific device quirks now covered by the chassis type.

Finally refactor some Lenovo devices using this quirk and redefine Dell
2-in-1 with this quirk using chassis type.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1390>
2026-01-05 04:44:41 +00:00
Peter Hutterer
58228f12f0 tools: fix the man page for the libinput-test command
The way we run this, the feature is appended to the libinput-test
command so this resulted in trying to execute libinput
libinput-test-libinput-test-suite.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1384>
2026-01-05 01:53:41 +00:00
Peter Hutterer
b48ce4c5be test: fix --help output for --filter-deviceless
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1384>
2026-01-05 01:53:41 +00:00
Peter Hutterer
6c2b9dcbde meson.build: add a summary for the test options
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1384>
2026-01-05 01:53:41 +00:00
Peter Hutterer
1d4ce84746 test: only use the quirks srcdir if we have a builddir
Same approach as we already do for other constants though note the
builddir_lookup() hack only works for release builds.

Closes #1230

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1384>
2026-01-05 01:53:41 +00:00
David Santamaría Rogado
08a8e0cc38 quirks: add missing match in synaptic touchpad
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1391>
2026-01-02 06:07:28 +01:00