Peter Hutterer
a0dc0997f5
meson.build: explicitly convert a boolean to string
...
Fixes:
DEPRECATION: Variable substitution with boolean value 'MESON_ENABLED_DEBUG_GUI' is deprecated.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1445 >
2026-03-13 12:15:21 +10:00
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
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
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
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
a202ed6115
Use a newtype usec_t for timestamps for better type-safety
...
This avoids mixing up milliseconds and usec, both by failing if
we're providing just a number somewhere we expect usecs and also
by making the API blindingly obvious that we're in usecs now.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1373 >
2025-12-12 04:15:15 +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
Peter Hutterer
141f571aae
tools: don't set the tool pressure range if we're using the default
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1340 >
2025-10-24 01:55:25 +00:00
Peter Hutterer
dd3f931481
plugins: rename the flags to libinput_plugin_system_flags
...
"libinput_plugins_flags" is bound to be annoying to approximately
everyone who'll ever have to use them so let's rename this while we
still can. Renamed to libinput_plugin_system_flags to leave the
namespace open for a possible future libinput_plugin_flags that works
on individual plugins.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1337 >
2025-10-23 13:13:01 +00:00
Peter Hutterer
4b1bae3f8c
tools/replay: rmdir, not unlink for directories
...
And if the directory happens to be nonempty, well, maybe anyother
libinput reply is running so let's ignore that.
Fixes: cdfe34f62a ("replay: use the runtime quirks for our replay quirks")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1330 >
2025-10-20 02:01:23 +00:00
Peter Hutterer
f9977dba9c
tools/replay: set the multiprocessing start method to fork
...
Python 3.14 has changed from fork to forkserver[1] which causes
libinput replay to fail with the following error when starting the
subprocesses:
ValueError: ctypes objects containing pointers cannot be pickled
This is caused by the libevdev device being passed to the sub process.
A more proper fix may be to only initialize the device in the subprocess
and then signal the process to start replaying. But meanwhile, switching
back to fork will do.
[1] https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods
Closes #1204
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1330 >
2025-10-20 02:01:23 +00:00
Sertonix
aa7d58005e
Fix format strings on 32-bit with 64-bit time_t
...
This fixes a segfault when running the test suite on ppc musl
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1318 >
2025-10-14 05:40:19 +00:00
Peter Hutterer
cdfe34f62a
replay: use the runtime quirks for our replay quirks
...
Closes #1166
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1297 >
2025-08-12 07:58:07 +00:00
Peter Hutterer
5495511485
tools: move a clang-tidy silence back to where it needs to be
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1292 >
2025-08-06 07:34:54 +00:00
Peter Hutterer
d557a649fd
Add a public plugin system to libinput
...
This patch adds a new API for enabling public "plugins" in libinput, in
addition to the exisitng internal ones. The API is currently limited to
specifying which paths should be loaded and whether to load them.
Public plugins are static, they are loaded before the context is initialized
and do not update after that.
If plugins are to be loaded, libinput will then run through those paths,
look up files and pass them to (future) plugins to load the actual
files.
Our debugging tools have an --enable-plugins and
--disable-plugins option that load from the default data paths
(/etc/libinput/plugins and /usr/lib{64}/libinput/plugins) and from
the $builddir/plugins directory.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1192 >
2025-08-01 15:38:39 +10:00
Peter Hutterer
59f0d8f647
tools/replay: improve the verbose output a bit
...
Make sure our SYN_REPORT line is indented correctly for multi-device
replay and match the output a bit closer to the one from libinput
record.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1286 >
2025-08-01 11:24:06 +10:00
Peter Hutterer
96d1954dce
tools: add missing AttrIsVirtual handling for listing quirks
...
If a device has AttrIsVirtual set in the quirks we'd abort() when trying
to list those quirks.
Fixes: efb4b6a3be ("evdev: detect virtual devices")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1281 >
2025-07-30 05:43:03 +00:00
Peter Hutterer
b8651d798c
tools: add a debug-tablet-pad tool
...
A simple tool to check the evdev and libinput events from a tablet pad.
This is near-identical to the existing debug-tablet tool but adjusted
for tablet pad events.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1280 >
2025-07-28 23:40:33 +00:00
Peter Hutterer
e8d24f818b
util: add two macros for clearing a line
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1280 >
2025-07-28 23:40:33 +00:00
Peter Hutterer
cfec80582e
meson.build: change from config.set10() and #if to config.set() and #ifdef
...
config.set10 is much more convenient and nicer to read but can provide
false positive if the value is 0 and #ifdef is used instead of #if. So
let's switch everything to use #ifdef instead, that way we cannot get
false positives if the value is unset.
Closes #1162
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1277 >
2025-07-28 12:04:09 +10:00
Peter Hutterer
79ea713aa3
tools: fix ruff format for libinput-replay
...
Fixes: 89c2f29d2c ("tools/libinput-replay: Warn if writing to local-overrides fails")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1272 >
2025-07-15 16:26:59 +10:00
José Expósito
89c2f29d2c
tools/libinput-replay: Warn if writing to local-overrides fails
...
Closes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1153
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1264 >
2025-07-09 21:34:54 +00:00
Peter Hutterer
b347cc8691
pre-commit: bump to latest ruff-format
...
And update our python files according to latest ruff format output.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1259 >
2025-07-09 00:13:00 +00:00
Peter Hutterer
2a1095924b
Run clang-format over the code
...
This uses the .clang-format file in the follow-up commit, but committed
prior to that to ease review of said file and various integrations.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1246 >
2025-07-01 16:42:44 +10:00
Peter Hutterer
aebf3cd491
Add trailing commas to prevent clang-format oddities
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1246 >
2025-07-01 16:36:14 +10:00
Peter Hutterer
784312a494
test: add clang-format directives to prevent formatting
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1246 >
2025-07-01 16:36:14 +10:00
Peter Hutterer
65e7cd5953
tools: handle an empty quirks list in the libinput recording
...
Fixes: 548279abee ("tools: store virtual property in recordings")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1243 >
2025-06-24 02:57:31 +00:00
Peter Hutterer
a2694738cb
tools: per-slot-delta initialize the pressure thresholds to zero
...
Python is unhappy about comparing None to > 0
Fixes: 9c042e9620 ("tools: add pressure threshold support to analyze per-slot-delta")
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1243 >
2025-06-24 02:57:31 +00:00
Peter Hutterer
b61a896407
util: fix the ANSI escape codes for bright colors, add some more
...
The previous incarnations of BRIGHT_FOO were actually bold foo. Change
the colors over to use the actual bright colors and make bold a separate
set of defines.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1240 >
2025-06-23 12:52:57 +00:00
Peter Hutterer
8f132481b3
zsh: add shell completion for the eraser button
...
Plus a note in tools/shared.h so we don't keep forgetting about this.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1234 >
2025-06-20 10:01:20 +10:00
Peter Hutterer
f6c4a361c0
tools: disable GTK's deprecated warnings
...
I'd be surprised if those get removed before the whole X11 support is
removed - and in that case we can remove the x11 support as well.
So let's disable the warnings and deal with it when it truly breaks -
there are no replacements for what we want to do here after all.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1233 >
2025-06-19 14:50:25 +10:00
Peter Hutterer
9c042e9620
tools: add pressure threshold support to analyze per-slot-delta
...
Color touches above the minimum threshold and above the down threshold
so it's easier to analyze a recording. Sometimes touches move
unexpectedly but if it's low-enough pressure this may not affect
libinput.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1225 >
2025-06-19 00:00:48 +00:00
Peter Hutterer
c48aff86d7
tablet: implement eraser button disabling
...
This adds a new (internal) plugin that is responsible for eraser button
disabling.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1218 >
2025-06-18 19:38:14 +10:00
Peter Hutterer
4ef14e14e4
Add an API for configurable eraser button behavior
...
This adds the public API to configure an eraser button on a tablet tool
to emulate a normal button. In DEFAULT mode the eraser button will
simply do whatever it does by default (i.e. toggle to eraser).
In BUTTON mode the eraser button will be converted to a regular tool
button event, with libinput handling the underlying proximity event
madness.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1218 >
2025-06-18 19:38:14 +10:00
Ryan Hendrickson
548279abee
tools: store virtual property in recordings
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1213 >
2025-06-08 23:55:10 +00:00
Peter Hutterer
f653ce0a22
Fix links to point to the current doc pages
...
The underscored page names date back to doxygen and have been obsolete
for many years now.
Closes #1123
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1202 >
2025-05-16 05:45:51 +00:00
Peter Hutterer
0ecd08c134
tools: use __attribute__(cleanup)
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184 >
2025-04-16 17:04:58 +10:00
Peter Hutterer
546debe926
Remove empty lines between closing braces
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1190 >
2025-04-16 11:44:09 +10:00
Peter Hutterer
5c751491fa
Add a few missing includes for config.h
...
This caused the headers to not haved _GNU_SOURCE set which in turn
caused clang-tidy to complain because util-strings.h didn't have
strtod_l.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1175 >
2025-04-04 15:47:23 +00:00
Peter Hutterer
e316e7c4b0
tools: disable clang-tidy warning about using floats for loop counters
...
Really doesn't matter here.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1175 >
2025-04-04 15:47:23 +00:00
Peter Hutterer
0fc52abd79
util: change the builddir_lookup() to return a boolean
...
All but one callers of this function only care about yes/no, so let's
change it to only return the build dir in the one case it's needed.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1175 >
2025-04-04 15:47:23 +00:00
Peter Hutterer
097e947523
tools: add missing include
...
struct option is used in one of the static inlines here, so let's
include getopt.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1175 >
2025-04-04 15:47:23 +00:00
Peter Hutterer
d2969f5203
tools/record: correct the --help output for autorestart
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1173 >
2025-04-04 04:47:36 +00:00
Peter Hutterer
9f98e6d573
tools/debug-events: print all available options
...
They're still without explanation but better than just printing
"[options]" without even pointing to the man page.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1162 >
2025-03-26 11:26:25 +10:00
Peter Hutterer
9907cf2eeb
Move the event printing out into a utility
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1156 >
2025-03-13 06:13:38 +00:00
Peter Hutterer
28e896916a
tools/debug-events: separate event handling from event printing
...
Move the big switch statement into a helper function and reduce it to a
statement that only does that bits that weren't related to printing.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1156 >
2025-03-13 06:13:38 +00:00
Peter Hutterer
1dd8a8965c
tools/debug-events: make the print_ functions return the printed string
...
Two advantages here: fewer actual printf() calls making the output
slightly more coherent if there are other things writing to stdout but
also better re-usability since we can now move the print functions to
shared code.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1156 >
2025-03-13 06:13:38 +00:00
Peter Hutterer
11aa71e78e
tools/list-devices: print vid/pid as well
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1153 >
2025-03-13 05:29:34 +00:00
Peter Hutterer
4ac52b4f1b
tools: support sendevents mode in debug-events
...
Disabling sendevents was already supported via an fnmatch() and
--disable-sendevents but to test things like disabling on an external
mouse, let's expose this option too.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1152 >
2025-03-13 05:17:07 +00:00