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
Peter Hutterer
1d9e307e2b
touchpad: implement support for three-finger drag
...
Exposed via new configuration option this enables 3 and 4 finger
dragging on touchpads. When enabled a 3/4 finger swipe
gesture is actually a button down + motion + button up sequence.
If tapping is disabled the drag starts immediately, if tapping is
enabled the drag starts after the tap timeout/motion so we can distinguish
between a tap and a drag.
When fingers are released:
- if two fingers remain -> keep dragging
- if one finger remains -> release drag, switch to pointer motion
When 3/4 fingers are set down immediately after releasing all fingers
the drag continues, similar to the tap drag lock feature. This drag lock
is not currently configurable.
This matches the macos behavior for the same feature.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042 >
2025-02-18 06:44:01 +00:00
Peter Hutterer
9d214e1c19
tools/list-devices: add missing config options to the output
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140 >
2025-02-17 07:59:05 +00:00
Peter Hutterer
d33c83b1b1
tools/list-devices: add helper to print aligned values
...
This makes it easier to re-align all columns.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140 >
2025-02-17 07:59:05 +00:00
Peter Hutterer
c8ee24ce17
tools/list-devices: reword the man page a bit
...
Hopefully a slightly better explanation that what we had before.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140 >
2025-02-17 07:59:05 +00:00
Peter Hutterer
dbe8f7fede
tools/list-devices: allow listing some devices only
...
$ libinput list-devices /dev/input/envent0
Now does what one would expect.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1140 >
2025-02-17 07:59:05 +00:00
Peter Hutterer
74617de48d
tools/record: record HID_BPF properties too
...
If this property is set we likely have a udev-hid-bpf property
loaded into the device. Knowing this is going to be important for
debugging why a device may or may not work so let's record this.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1121 >
2025-01-20 10:29:47 +00:00
Peter Hutterer
2c0c4a6516
Replace strneq() with hardcoded lengths with strstartswith()
...
Slightly less efficient but easier to read and it's not possible to
accidentally provide the wrong length. Plus it handles null pointers
correctly so get to skip the checks (which weren't needed for strneq()
either, but still).
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1121 >
2025-01-20 10:29:47 +00:00
Peter Hutterer
c3bf478d41
util: add truefalse and yesno macros for easy string conversion
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1118 >
2025-01-20 09:54:32 +00:00
Peter Hutterer
d52bb9ed4d
tools/per-slot-delta: optionally show the distance to the original point
...
This makes it easier to quickly gather how far a touch has moved since
it started, compared to the initial starting position. This again makes
it easier to determine if a threshold required for e.g. scrolling has
been met.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101 >
2025-01-09 02:12:10 +00:00
Peter Hutterer
5f8f715017
tools/per-slot-delta: refactor the printing of a slot
...
This makes it easier to optionally print extra components of that slot.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101 >
2025-01-09 02:12:10 +00:00
Peter Hutterer
5df1d26aa2
tools/per-slot-delta: use a Point class for slot position/delta
...
Better abstraction, especially when we introduce more than just those
two.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101 >
2025-01-09 02:12:10 +00:00
Peter Hutterer
a7ff3e0508
tools/per-slot-delta: remove some duplication for axis handling
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101 >
2025-01-09 02:12:10 +00:00
Peter Hutterer
01f133fbc4
tools/per-slot-delta: use dataclasses and enums
...
Slight modernization of the code
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1101 >
2025-01-09 02:12:10 +00:00
Peter Hutterer
117d91b93f
tools/libinput-replay: use list comprehension instead of append
...
And remove the unnecessary del processes, we're in a block so processes
ceases to exist there anyway.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1102 >
2024-12-22 23:59:22 +00:00
Peter Hutterer
193aacf61a
tools/libinput-replay: interrupt only the ongoing event sequence with ctrl+c
...
If libinput replay is currently replaying events, stop that sequence and
go back to the start if the user presses Ctrl+C. Only on the second
Ctrl+C do we fully exit.
This helps debugging long recordings where we don't want to keep
producing events after some initial event sequence.
Closes #1064
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1102 >
2024-12-22 23:59:22 +00:00
Peter Hutterer
2e9d8df74e
tools/debug-gui: color the fingers with different colors
...
Follow-up to commit 713892c162 ("Number the fingers by slot in debug-gui")
this changes the colors slightly for each finger, making it easier to
track visually.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1103 >
2024-12-20 01:15:11 +00:00
Peter Hutterer
d63689003f
tools: only warn once about our lack of support for multiple fingers
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1096 >
2024-12-18 08:49:34 +00:00
Peter Hutterer
52679e1296
tools/libinput-replay: print a separator line for EV_SYN events
...
If running with --verbose having that line makes it a lot easier to
look at the event sequence.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1094 >
2024-12-18 08:07:18 +00:00
Peter Hutterer
9988f4242e
tools/measure-touchpad-pressure: require max > min for a range
...
Otherwise a resulting quirk will fail when parsed by libinput which
enforces this too.
Closes #1060
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1089 >
2024-12-10 10:00:39 +00:00
Peter Hutterer
cf5b7bee01
Add tablet area configuration
...
This adds the configuration option to define a rectangle that serves as
an input area on external tablets such as an Intuos.
The intention behind this is to make this input area behave as if it was
the only physical input area on this tablet with libinput emulating
proximity events as required for where the tools moves in and out
of this area.
This could also be achieved with the existing calibration setting but
area configuration is not calibration and we don't want to expose other
side-effects of the matrix (e.g. scaling and rotation) for these
devices.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013 >
2024-11-05 12:10:48 +10:00
Peter Hutterer
49bbef6468
tools/debug-events: print bugs in bold red
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013 >
2024-11-05 12:05:05 +10:00
Peter Hutterer
86915213c8
tools: sort the options in debug-events match page
...
We now have enough config options that having them unsorted makes it
hard to find the right option.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1075 >
2024-11-04 15:48:49 +10:00
Peter Hutterer
a61c876412
pre-commit: drop black, use ruff-format instead
...
And switch to the current-ish version of the ruff pre-commit hook,
including updating the repo.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1072 >
2024-10-29 13:48:31 +10:00
Peter Hutterer
15af1c0017
tools: change direct type check to isinstance
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1072 >
2024-10-29 13:27:35 +10:00
Peter Hutterer
54f3733b76
tools: print full pad mode group info in libinput-list-devices
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1068 >
2024-10-22 15:46:57 +10:00
Peter Hutterer
f5cc45e409
tools: add rel dial support to libinput-list-devices
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1068 >
2024-10-22 11:54:45 +10:00
Peter Hutterer
54dccd66d1
Fix a few potential NULL dereferences
...
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1052 >
2024-09-30 15:35:36 +00:00