Commit graph

5724 commits

Author SHA1 Message Date
Peter Hutterer
c0c809aaa1 util: fix documentation issues for newtypes
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1373>
2025-12-12 04:15:15 +00:00
Peter Hutterer
e8dfc3bfd6 util: make the newtype comparision functions return bool
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1373>
2025-12-12 04:15:15 +00:00
Sicelo A. Mhlongo
b3f7b4b1ea evdev: add support for SW_KEYPAD_SLIDE
A few devices have a keyboard/keypad which can be slid under the device,
leaving the device with only touch-based interaction. The corresponding kernel
event is reported as SW_KEYPAD_SLIDE [0]. Implement support in libinput.

Since the position of the switch varies across devices, it cannot always be
certain whether the keypad is usable when the switch is in the set position.
Therefore, do not automatically disable the keyboard.

[0] e68d80b13b/include/linux/linux/input-event-codes.h (L885)

Closes: #1069
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1242>
2025-12-11 13:28:41 +02:00
Peter Hutterer
0285001272 touchpad: make the dwt/dwtp timeout inclusive min/max
This makes it easier in callers that don't really differ between
inclusive and exclusive and makes the visualization in UIs a bit
nicer to look at too.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1377>
2025-12-10 03:07:36 +00:00
Peter Hutterer
bde6d07d57 quirks: replace ModelPressurepad with setting INPUT_PROP_PRESSUREPAD
This is the more generic approach and doesn't require us to have any
specific implementation in libinput itself.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1374>
2025-12-09 06:07:01 +00:00
Peter Hutterer
1b4dbb9087 doc/user: minor update to the forcepad/pressurepad documentation
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1374>
2025-12-09 06:07:01 +00:00
Peter Hutterer
d5d38b2ed1 doc/user: fix two typos in ref anchors
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1374>
2025-12-09 06:07:01 +00:00
Peter Hutterer
38b5c2e0cc touchpad: add configurable timeouts to disable-while-trackpointing
Same motivation as in commit
"touchpad: add configurable timeouts to disable-while-typing"

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1372>
2025-12-02 09:24:15 +10:00
Peter Hutterer
20851b5020 touchpad: add configurable timeouts to disable-while-typing
Touchpads that don't give us useful palm detection data are getting more
common (see e.g. our ABS_MT_TOOL_TYPE quirks). On those touchpads we can
only rely on dwt and palm edge detection which means those two must be
more spot on than ever before.

DWT in particular is more prone to user-specific requirements, the
current timeouts have been insufficient for a number of users. So let's
make them more configurable.

Currently limited to >100ms and <5 seconds to avoid DWT being used in
the xkcd workflow style.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1372>
2025-12-02 09:24:15 +10:00
Peter Hutterer
2003ab3aef test: rename a dwt test for better clarity
This is the "short-timeout after a single key press" dwt test so let's
rename it that way

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1372>
2025-12-02 09:20:08 +10:00
Peter Hutterer
4bb6a31894 doc: fix a few miss-hyphenated disable-while-typing comments
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1372>
2025-12-02 09:20:08 +10:00
Peter Hutterer
db6a04665c touchpad: use INPUT_PROP_PRESSUREPAD as signal it's a pressurepad
Because, well, it says so on the box now. No more quirks, hopefully!

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1359>
2025-12-01 21:39:11 +00:00
Peter Hutterer
7621edab05 include: sync headers with kernel 6.18
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1359>
2025-12-01 21:39:11 +00:00
Peter Hutterer
39aea2a8d6 test: silence a valgrind warning
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1370>
2025-11-27 09:32:13 +10:00
Peter Hutterer
7e8298e9ec tablet: when destroying a tablet, unlink the tablet tools
If a caller holds a ref to a tablet tool when the device is
destroyed, the tool didn't get removed from the tablet->tool_list.

Later on tool unref the list_remove() would try to reset the pointers
but the list head was long since freed, causing an invalid write.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1370>
2025-11-27 09:26:54 +10:00
Peter Hutterer
49d9528bdf tablet: after three valid prox out events, unload the forced prox plugin
Once we receive three valid proximity out events for the pen, unload the
plugin that generates forced proximity in events for tablets that
don't send BTN_TOOL_PEN.

Closes #1222

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1370>
2025-11-26 10:55:03 +10:00
Peter Hutterer
1e8901d009 tablet: only apply eraser button settings if we have a device
If the device is unplugged, our tool's last_device is NULL. If a caller
then tries to the toggle the eraser button setting libinput would crash.
Fix this by simply skipping the configuration until the tool goes back
into proximity over some other device (if any).

Closes #1223

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1370>
2025-11-26 10:54:47 +10:00
Peter Hutterer
a6ad084280 tablet: return the wanted eraser button mode/button from the config
This matches our behavior for other settings - always return the
user-configured setting from the configuration API, not the current
setting (which may be delayed until the device is in a netural state).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1370>
2025-11-26 10:32:18 +10:00
Peter Hutterer
11b97edcdc libinput 1.30.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-11-25 13:40:43 +10:00
Peter Hutterer
c2f9ffe17e doc/user: drop references to the touchpad-edge-detector
We've had libinput measure touchpad-size for 5 years now, let's refer
only to that.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1368>
2025-11-24 14:29:56 +10:00
Peter Hutterer
21e3a76bf5 libinput 1.29.902 2025-11-18 12:29:32 +10:00
Peter Hutterer
9461d1a9a1 Revert "lua: drop compatibility to 5.1 to allow for luajit"
While luajit seems to be the most popular (and fastest) lua
implementation for higher-level implementations, at the system level
it is relatively unused. Lua 5.4 on the other hand is used by other
system-level components like wireplumber and RPM. In the latter case
this means that lua is already available on every rpm-based distro
without further dependencies.

The performance of 5.4 seems to be acceptable and while luajit may be
faster the extra dependency requires more maintenance. Let's only expose
ourselves to that if absolutely needed.

This is not a strict revert because the code has changed a bit since
with several bugfixes deployed on top.

This reverts commit 2723cadaeb.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1366>
2025-11-18 01:46:53 +00:00
Peter Hutterer
a595f0bd48 lua: export _VERSION so plugins can check the lua version
Since we only support one version this is not very informative but let's
include this now in case we ever need it in the future.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1365>
2025-11-17 16:48:35 +10:00
David Senoner
32ed3060f9 meson.build: use absolute path for callouts in udev rules
Udev rules can be put in many different directories to be found by udev
(see link #1). The callouts can be put only in one specific directory
if you want them to be found by using a relative path (only in
UDEV_LIBEXECDIR, see link #2). By passing the absolute path to the rule
you can make sure the callout will always be found.

Link 1: https://man7.org/linux/man-pages/man7/udev.7.html
Link 2: https://github.com/systemd/systemd/blob/main/src/udev/udev-spawn.c#L289

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1364>
2025-11-12 07:49:18 +01:00
Yinon Burgansky
a12dc6eba3 filter: differentiate scroll wheel from button scrolling to fix wheel speed
Commit 94b7836456 ("filter: support accelerating high-resolution
scroll wheel events") introduced a regression where high-res scroll
wheel events were incorrectly normalized by DPI. Mice with non-default
DPI (e.g., Logitech G502 at 2400 DPI) had their scroll wheel speed
reduced by the DPI ratio (1000/2400), resulting in 2-3x slower
scrolling.

The "noop" filter functions were actually performing DPI normalization
or applying a constant acceleration factor, which is appropriate for
button scrolling but incorrect for scroll wheels that have their own
units.

Add a filter_scroll_type enum (CONTINOUS, WHEEL, FINGER to match the
public events) passed through the filter_scroll interface. Update all
filter implementations to skip acceleration and normalization for wheel
events while maintaining existing behavior for button scrolling and
touchpad scrolling.

The custom acceleration profile continues to accelerate high-res wheel
events as designed.

Fixes: 94b7836456 ("filter: support accelerating high-resolution scroll wheel events")

Closes: #1212

Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1363>
2025-11-11 14:43:41 +10:00
Marien Zwart
f6caae2289 quirks: add quirk for MX Master 4
The scrollwheels are similar to the MX Master 3, and need the same
quirks: the horizontal wheel events are inverted (it scrolls "naturally"
by default while the horizontal scrollwheel direction is "traditional"),
and middle-clicking without scrolling is very difficult with high-res
scroll events (from the hid_logitech_hidpp kernel module) enabled.

This adds the device ID seen through Bluetooth, which seems to be the
only one we can add a quirk for:

- When connected using the Bolt receiver, there is no separate device ID
  for the mouse (just the same 046d:c548 ID for the receiver already
  documented as supporting multiple mice).

- When connected through USB, the mouse charges but does not provide HID
  events through USB (it can be used while charging but only by using a
  separate Bluetooth or Bolt connection for HID).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1362>
2025-11-09 00:09:47 +00:00
Jan Hendrik Farr
20a3131947 quirks: add quirk for Google Chromebook Rull
Signed-off-by: Jan Hendrik Farr <kernel@jfarr.cc>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1360>
2025-11-08 23:53:49 +00:00
Marien Zwart
822e571272 doc: fix gitlab remote url
SSH to gitlab.freedesktop.org times out.
ssh.gitlab.freedesktop.org (copied from the Gitlab UI) works..

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1361>
2025-11-08 15:02:59 +11:00
Peter Hutterer
9c78f989fb CI: bump to Fedora 43 and Ubuntu 25.10
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1355>
2025-11-07 15:13:08 +00:00
Peter Hutterer
9b37ffd340 meson.build: fix indentation for the python files
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1357>
2025-11-06 23:46:42 +00:00
Peter Hutterer
b9a04e4d57 meson.build: export the plugin dir via pkgconfig
This is for the system-wide plugindir only - the only path where we'd
expect other packages to put plugins.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1357>
2025-11-06 23:46:42 +00:00
Peter Hutterer
4fd5fe9d30 Fix clang-tidy false positives
Array out of bounds complaints but it's a false positive where
clang-tidy makes up some event flow that cannot happen.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1358>
2025-11-06 23:31:27 +00:00
Peter Hutterer
941aa9f997 plugins: add an example for using a wheel to trigger button scrolling
See https://gitlab.freedesktop.org/libinput/libinput/-/issues/1206

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1356>
2025-11-06 23:18:43 +00:00
Peter Hutterer
b870abd2f3 libinput 1.29.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-11-04 11:58:29 +10:00
Peter Hutterer
ad6f580b6d lua: add select to the list of allowed functions
This function is safe (and was already documented) so let's make sure
it's available.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:15 +00:00
Peter Hutterer
4ffd8ab544 lua: fix the event type/code loops - EV_MAX/ABS_MAX is inclusive
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:15 +00:00
Peter Hutterer
eac44529d8 lua: return an empty table as device info after device removal
As the documentation already promises.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
4fe3225050 lua: remove the unpack global function
Looks like 5.1 and later has unpack as table.unpack().

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
45878c3aac lua: fix superfluous comma
Not sure how this compiled but whoah, definitely not supposed to be
there.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:14 +00:00
Peter Hutterer
f0d8002255 plugins: fix some minor issues with the example plugins
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:13 +00:00
Peter Hutterer
037c07d76f doc/user: fix a few issues with the Lua API documentation
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1354>
2025-11-04 00:27:13 +00:00
Peter Hutterer
1dcf630584 plugins: add an example plugin on how to reconfigure the Copilot key
As Microsoft has decreed, that key sends LEFTMETA + LEFTSHIFT + F23
(usually across multiple frames) and the then the same in reverse when
released.

xkeyboard-config 2.44 maps this sequence by default to XF86Assistant but
for the use-cases where this does not work reshuffling the whole event
sequence is the best approach and that can easily be done with a plugin.

Note that this is the minimum effort plugin - it works for one
keyboard at at time (duplicate the plugin if two keyboards are needed,
or remove the vid/pid check) and it does *not* intercept the meta/shift
key presses and delay them, it simply releases them on F23 and then
replays the new sequence. Good enough for an example plugin.

Example sequence produces shift + a on press and releases a + shift on
release. Holding the key will thus produce AAAAAAAAA which is an
excellent summary of how this key was designed.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1352>
2025-11-03 03:57:00 +00:00
Peter Hutterer
eb01a4e73f plugins: add meson option to autoload plugins
Add an option to enable autoloading plugins from the default paths.
This makes testing and adoption for new users easier as they can (if
necessary) rebuild libinput with that option enabled instead of having
to wait for the compositor stack to update.

Autoloading will only use the default paths (/etc and /usr/lib) and will
only happen if the client does not modify those paths since that implies
the client wants to load plugins themselves. A client that adds a plugin
path but doesn't load the plugins is considered buggy anyway.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1347>
2025-10-31 05:25:29 +00:00
Peter Hutterer
f27fbdfa53 meson.build: change set10 to set
Follow-up to cfec80582e ("meson.build: change from config.set10() and #if to config.set() and #ifdef")
which was parallel to 9e37bc0cfa and the latter didn't get updated.

Fixes: 9e37bc0cfa ("plugins: add support for lua plugins to change evdev event streams")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1347>
2025-10-31 05:25:29 +00:00
Jan Hendrik Farr
07659db3d9 quirks: add quirk for Google Chromebook Roric
Signed-off-by: Jan Hendrik Farr <kernel@jfarr.cc>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1353>
2025-10-30 13:40:59 +01:00
Peter Hutterer
f18bf988f7 lua: drop the log global in favor of libinput:log_*
The existence of the log global was in part due to early (pre-merge)
versions of the Lua plugins supporting multiple libinput plugin objects
per file. This is no longer the case and integrating the log functions
into the (single) libinput object makes the code more obvious (we're
calling libinput:log_debug() now, so it's obviously a libinput log
function) and we no longer mix dot with colon notations.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1350>
2025-10-30 13:12:50 +10:00
Peter Hutterer
6b9dbc2a25 lua: remove the inject_frame API
Injecting frame was the first implementation of adding event frames but
it has since effectively been replaced by append/prepend_frame which are
more predictable and easier to support.

In the Lua API injecting frames was only possible within the timer and
the only real use-case for this is to inject events that are then also
seen by other plugins. But that can be achieved by simply ordering the
plugin before the other plugins and using the append/prepend approach.

Until we have a real use-case for injecting events let's remove the API
so we don't lock ourselves into an API that may not do what it needs to
but needs to be supported for a long time.

Closes: #1210
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1351>
2025-10-30 02:08:13 +00:00
Peter Hutterer
2784973b4d doc/user: update the lua plugin documentation
Some clarifications, some fixes, some reshuffling, overall somewhat
better.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1349>
2025-10-30 01:46:33 +00:00
Peter Hutterer
22dda5b154 doc: some updates to the plugin system docs
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1349>
2025-10-30 01:46:33 +00:00
Peter Hutterer
07a9161ef2 tools: add support for NO_COLOR/FORCE_COLOR
Environment variables to control whether the output should not have
color or must have color, regardless of the tty-ness of the output
stream.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1348>
2025-10-27 12:35:44 +10:00