Commit graph

22 commits

Author SHA1 Message Date
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
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
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
f17ef2d543 tools/per-slot-delta: handle KeyboardInterrupts nicely
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-03-10 00:24:51 +00:00
Peter Hutterer
fe30bea36e tools/per-slot-delta: print the button state too while analyzing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-03-10 00:24:51 +00:00
Peter Hutterer
1dbdef8fdb Use python black for all pyhon file formatting
Let's enforce a consistent (and verifiable) style everywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-28 21:02:45 +00:00
Torstein Husebø
18c9265224 treewide: fix typos
Signed-off-by: Torstein Husebø <torstein@huseboe.net>
2020-12-16 22:08:23 +01:00
Peter Hutterer
9b3e0e8043 tools: per-slot-delta: if a NONE touch gets data, assume it's starting
If we have a recording that started after the touch down, let's start that
touch on the first x/y position update.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-04 10:43:33 +10:00
Peter Hutterer
9ecac89bab tools: per-slot-delta: construct the right InputEvent
d107d5 broke this tool because the InputEvent was our local datastructure,
which needed the evbit redirect.

Fixes d107d58cd2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-04 10:43:33 +10:00
Peter Hutterer
d107d58cd2 tools: per-slot-delta: skip the extra evbit indirection
e.code is the evbit anyway, we don't have to convert it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-16 06:10:25 +00:00
Peter Hutterer
78dcbec7a4 tools: per-slot-delta: drop an unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 15:32:22 +10:00
Peter Hutterer
f5ab18ab8f tools: per-slot-delta: always mark slot 0 as used
If a device never sends ABS_MT_SLOT, our output was emtpy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 15:32:17 +10:00
Peter Hutterer
d88ad293d2 tools: per-slot-delta: add arguments to set a threshold and ignore-below
The threshold colors events above a certain value in red, ignore-below skips
any line below that threshold.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 14:35:27 +10:00
Peter Hutterer
61296feaee tools: per-slot-delta: init the slots with the right index
The index is unused, but useful during debugging

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 13:50:53 +10:00
Peter Hutterer
4e03175307 tools: per-slot-delta: move printing the slot data into a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 13:50:53 +10:00
Peter Hutterer
5a9fb539d9 tools: per-slot-delta: print the BTN_TOUCH etc. bits in-line
New output example:

 9.408899    +5ms DBL: ↑↗    1/  -9 | →→    0/   0 |

where DBL stands for BTN_DOUBLE.

This also widens the relative time by one so we don't lose formatting for >1s
delta time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 13:38:48 +10:00
Peter Hutterer
c23484a9ec tools: per-slot-delta: only render the slots that have been seen
Makes the output easier to understand given that most touchpads have 5+ slots
but don't actually use them (or the users don't).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-04-11 13:38:48 +10:00
Peter Hutterer
e11bad41f5 tools: add a libinput analyze command with the per-slot-delta subcommand
I've been using this script ever since libinput record was available, might as
well ship it with libinput so I don't have to remember where it lives.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-16 08:35:43 +10:00