Commit graph

5810 commits

Author SHA1 Message Date
Peter Hutterer
c6813dc7d8 tools: add --compress-motion-events to the man page and zsh completion
Fixes: dc249b0ffe ("tools/debug-events: add ability to compress motion events")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1443>
2026-03-11 14:22:40 +10:00
Ilya Kamenko
8dd25ece10 Fold hold-to-scroll into existing scroll button lock mode
Instead of adding a new ENABLED_HOLD enum value, modify the existing
ENABLED lock mode so that hold+scroll+release doesn't engage the lock.

Add a 500ms grace period: if the button was held and used to scroll for
longer than 500ms, releasing the button does not engage the lock
(temporary scroll). If released within 500ms (e.g. shaky hands
triggering accidental motion), the lock still engages as before.

This fixes the unintuitive behavior where the lock engages even after
actively scrolling, without requiring new API surface.

Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1259

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1435>
2026-03-10 23:12:25 +00:00
Mingcong Bai
43547b461b quirks: add Goodix pressure pad quirk for 27C6:01E7
This touchpad is found on the newly released Lenovo ThinkBook G8+ IPH.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1442>
2026-03-10 11:37:34 +08:00
David Santamaría Rogado
2ddc734114 test: set ID_INTEGRATION into test devices
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1429>
2026-03-10 02:27:36 +00:00
David Santamaría Rogado
819e943ab0 evdev: use udev's ID_INTEGRATION
Now we have in udev the ID_INTEGRATION propery that tells us if a device
is internal or external, use it while still allow hwdb and quirks to
override it.

In the future is possible that we could remove quirks for keyboards
integration and hwdb for touchpads and joysticks integration.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1429>
2026-03-10 02:27:36 +00:00
David Santamaría Rogado
1c82aa1659 quirks: add some more goodix haptic touchpads
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1440>
2026-03-09 09:48:05 +01:00
David Santamaría Rogado
526130fe8d quirks: hp omnibook ultra flip 14 touch pressure
Add pressure attributes to make libinput measure touchpad-pressure
behave right.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1430>
2026-03-09 01:34:07 +00:00
David Santamaría Rogado
b95840d36e quirks: hp omnibook ultra flip 14 improve rule set
Some initial units had 14t-fh000 instead 14-fh0xxx in their product name
but they are exactly the same model.

We could match both in product version SBKPF or in board product name
8CDE. Match board as seems the way hp-wmi kernel module uses to match.

While at it rewrite the entire huge comment to a little less huge
comment but with more really interesting info.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1430>
2026-03-09 01:34:07 +00:00
Peter Hutterer
7726350420 tablet: allow for the eraser button to be any button
The previous restriction was BTN_STYLUS* or any button the pen
advertises. This is too restrictive - it works well enough for any pen
with less than 3 buttons (BTN_STYLUS3 is always available on those) but
otherwise it cannot work. A 3-button pen may not advertise any other
buttons, leaving us with the eraser button being a duplicate button. And
events cannot be distinquished between eraser button or real button.

Open up the configuration to effectively any BTN_ event code.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1436>
2026-03-09 01:14:21 +00:00
Peter Hutterer
cdcb827365 Fix the evdev_usage_is_button check for the BTN_STYLUS group
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1436>
2026-03-09 01:14:21 +00:00
Peter Hutterer
0a3ecbea24 tablet: fix missing linebreak after an error message
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1436>
2026-03-09 01:14:21 +00:00
BBaoVanC
db62bf7ab1 quirks/apple: Add AttrSizeHint to Magic Trackpad USB-C
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1437>
2026-03-04 04:53:28 +00:00
David Santamaría Rogado
9eae99d4fe quirks: microsoft surface keyboard event BTN_0
Apply AttrEventCode=-BTN_0 to all surface keyboards.

Fixes: #1251.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1431>
2026-02-22 08:40:11 +00:00
David Santamaría Rogado
a86b8a0008 doc: list-quirks should be quirks list
while at it replace also a code comment in the same line.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1432>
2026-02-20 19:56:46 +01:00
Sicelo A. Mhlongo
3428edf1ea doc/user: document keypad slide switch support
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1428>
2026-02-17 12:03:56 +02:00
Peter Hutterer
659967488e libinput 1.31.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-02-13 09:25:46 +10:00
Lorenzo Ianotto
b9fc550f28 Set ModelTabletModeNoSuspend only for Thinkpad S1 Yoga and X1 Yoga 1st gen
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1425>
2026-02-09 02:42:33 +00:00
Richie Roy Jayme
df8f5a3627 quirks: add quirk support for Goodix touchpad
This commit adds a specific vendor HWID for Goodix Haptic Touchpad to
improve detection and handling.

Signed-off-by: Richie Roy Jayme <rjayme.jp@gmail.com>
Signed-off-by: Richie Roy Jayme <rjayme2@lenovo.com>
Reviewed-by: Vishnu Sankar <vishnuocv@gmail.com>
Reviewed-by: Vishnu Sankar <vsankar@lenovo.com>
Reported-by: Ameer Ivan Julkarnain <ajulkarnain1@lenovo.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1426>
2026-02-07 08:27:58 +00:00
Peter Hutterer
e0ba559117 libinput 1.30.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1424>
2026-02-04 12:41:58 +10:00
Peter Hutterer
e78f4f689d util: add guards for the etrace/trace defines
This file is really useful on its own for other projects if
auto-included via export CFLAGS="$CFLAGS -include /path/to/file.h"
However, that causes compiler warnings, let's add indef checks for this
as a quick workaround.

Since these three come as a set and are only used for debugging, we can
ifndef them all in one go rather than individually.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1423>
2026-02-04 11:18:54 +10:00
Peter Hutterer
ad89a83ae6 tablet: ignore the tablet tool name if it's a generic tool
libwacom has generic pens that are used for devices that don't have tool
ids. Let's ignore the names for those pens since they're just made up
names anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1422>
2026-02-03 23:27:14 +00:00
Peter Hutterer
6d514ee6fa touchpad: add get_default_timeout for dwt and dwtp
I doubt this is really needed but our convention for all config options
is set/get/get_default so let's stick with that.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1421>
2026-02-03 13:01:59 +10:00
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