Too many recordings end up with the device list at the top when users redirect
stderr and stdout to the recordings file. This breaks yaml parsing and
requires manual removal of the first few lines.
Avoid this by prefixing the lines with a command character, this way the yaml
stays correct.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Where a device is replayed locally for testing, its udev properties should
match the recorded properties. Otherwise the testing results will not be
reliable.
The exception here is the device group which we currently don't set for
emulated devices and even if we did, it may intentionally differ anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This allows us to run the option parsing test without getting interrupted by a
million debug-gui windows popping up for half a second.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Given that some people appear to not read until the "is not installed" part of
the error message, let's reduce the error message to just that part. This may
be confusing where a user mistypes the actual command but that happens rarely
compared to those that can't run libinput record because it's in a different
package.
Fixes#500
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Leaving in-place all those where we know the length of the prefix, but
replacing all those where we were calling strlen on the prefix.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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>
Where libinput is installed, checking whether the fuzz is applied to the
device will always fail with an error - the udev rules will remove the
fuzz and copy its value to the LIBINPUT_FUZZ properties instead.
So let's fix this: where the fuzz shows up on the device print a warning
because libinput's udev rule isn't working. And where it's missing check
the udev properties and compare those to the settings instead.
Fixes#472
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
For backwards compatibility reasons, the hwdb.bin created udevadm hwdb
does not actually apply matches in the way you'd expect. systemd-hwdb
creates the newer format and is preferred.
Related: #472
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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>
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>
When a boolean quirk is set to "0", it is correctly disabled, but "libinput quirks list" and
"libinput record" showed it as "1".
This happens for example if ModelXXXX=0 is set in /etc/libinput/local-overrides.quirks, to
override a default quirk.
Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
Replacement for the touchpad-edge-detector tool with a slightly more
expressive design, hopefully cutting down on some of the bug reports.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's not the most important test outside of my machine and CI, so let's just
skip over it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
pytest is more powerful than unittest, so let's switch to that instead. And in
the process fix a few tests that for some reason succeeded even though they
shouldn't have (e.g. the autorestart test).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libinput record touchpad.yml /dev/input/eventX
or just
libinput record touchpad.yml
are simpler invocations and since we're quite limited in what we can record
(i.e. only device files) we can just check the argument list to figure out
whether there is something to record to.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
Processing os-release in the same buffer that the dmi modalias used caused the
dmi to be recorded as 'dmi: "VERSION_ID=31"'. The cause for that was simply
that the dmi modalias was read but not printed until after the os-release
information was processed.
Fix this two-fold: rearrange that each part now reads and prints in
one go, and rename the buffers so we don't re-use them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This shuts up scan-build complaining about memory leaks in libinput
debug-events (needs the right combination of --device option and eventually
triggering usage()) and saves us a bunch of unnecessary allocations.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Where we're replaying a device with quirks, those quirks will be placed into
/etc/libinput/local-overrides.quirks. For that to work, /etc/libinput needs to
exist so let's make it where required.
https://bugzilla.redhat.com/show_bug.cgi?id=1806322
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Because sometimes it's useful to know what distro a recording was made on, and
the kernel version doesn't always reveal that.
Fixes#428
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>