Commit graph

598 commits

Author SHA1 Message Date
Peter Hutterer
5cd27b070e tools: add a test for tool option parsing
We don't check for correctness in the output as such, just that whatever
combination of cmdline arguments still works/doesn't work. This is the
scaffolding and a few tests, but needs to be filled in, especially for
libinput measure and for some more complex combinations.

valgrind: requires one more python-related suppression
gitlab-ci: requires another environment variable so we know to skip the
	   --device tests (udev will time out on those)
meson: skip the test run in release builds, we pass the full path to the built
       libinput tool but rely on the subtool lookup that won't work in a
       release build

Fixes #174

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
36af7d312b tools: make the tools exit with exit code 2 on usage issues
This makes it easier to test for usage issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
bd52bf5421 tools: debug-events: install the signal handler before any libinput operations
On a CI container, we will time out trying to find the udev device for our
device node. This takes 2s, a SIGINT during this time should be treated the
same as one during the mainloop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
22890a4719 tools: handle sigint in debug-gui
Exit with success on SIGINT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
27bf3fb2ab tools: allow measuring single-touch ABS_PRESSURE
Fixes #173

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-06 00:24:06 +00:00
Peter Hutterer
fcfffd80d7 tools: drop a superfluous linebreak in the list-quirks output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-05 14:28:13 +10:00
Peter Hutterer
48a7c507f8 tools: handle the EventCodeDisable quirk in the quirks tool
This caused an assertion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-05 14:28:13 +10:00
Peter Hutterer
717b57b6a2 tools: align the rotation value with 3 digits
This is a 0-360 ranged value, so let's print it aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-27 10:27:19 +10:00
Peter Hutterer
6ed158f99d tools: add a missing space in the proximity in axis listing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-27 10:27:19 +10:00
Peter Hutterer
6e1f6d4182 quirks: replace the manual enumation of all quirks with a loop
Reduces the places we need to update bits for new quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-20 12:56:11 +10:00
Peter Hutterer
973a895d39 quirks: sort the quirks model flags in alphabetical order 2018-09-20 11:53:48 +10:00
Peter Hutterer
d616218c9a tools: fix a bunch of format conversion complaints
Fixes #137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-12 13:28:16 +10:00
Peter Hutterer
cb49e90472 tools: drop the libinput measure trackpoint-range tool
This tool is now obsolete, we don't use that range anywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-11 13:18:48 +10:00
Peter Hutterer
bf9c8e06ef tools: debug-events - print axes on tablet tip events
Bit of a weird diff, print_tablet_axes() was moved up and a single call to
print_tablet_axes() was added in the tablet tip event handler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-05 14:33:28 +10:00
Peter Hutterer
0e2f1babc5 quirks: add a quirk to monitor MSC_TIMESTAMP for pointer jumps
Currently enabled on all Dell i2c touchpads, these seem to be the ones that
needed it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-31 11:12:42 +10:00
Peter Hutterer
a661d7b717 tools: handle a finger down at startup for measure pressure/touch-size
Fixes #117

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-29 22:17:33 +00:00
Peter Hutterer
66ac659e36 touchpad: add support for size-based thumb detection
Fixes #97

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-29 16:35:14 -05:00
Peter Hutterer
e640bac867 tools: fix grab handling in libinput debug-gui
The libinput context's user_data was used for deciding whether to grab the
event device but also to hold the struct window data for the debug-gui. Worked
fine for the initial batch of devices, but any device coming in late would
just use the first field of the struct window to decide whether to grab or
not.

Fixes #122

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 17:04:51 +10:00
Kim Lindberger
99334e11bf
Add quirk to control velocity averaging, disable it by default
libinput applies averaging to the velocity of most pointer devices. Averaging
the velocity makes the motion look smooth and may be of benefit to bad input
devices. For good devices, however, it comes at the unfortunate price of
decreased accuaracy.

This change turns velocity averaging off by default (sets ntrackers to 2 instead
of 16) and allows for it to be turned back on via a quirk, for bad devices which
require it.
2018-08-22 12:12:55 +02:00
Kim Lindberger
f82eeae299
tools: fix ptraccel-debug tool for the new trackpoint multiplier
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-22 11:18:05 +02:00
Peter Hutterer
f78d6669e5 tools: debug-*: show unaccelerated deltas for pointer events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-08 10:07:43 +10:00
Peter Hutterer
e33fd7157f tools: record: don't bother setting last_ms to 0 on the first event
The first event we receive is set to a 0ms offset anyway. Setting last_ms to 0
on the first event means the first two events have +0ms offset printed to the
log. Skip it, so the second event has the right offset.

This is human-readable data only, no effect on the recording file itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-06 14:06:48 +10:00
Peter Hutterer
6d8b10153c tools: drop two unused imports
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-26 15:38:55 +10:00
Peter Hutterer
83840fb0bc Merge branch 'master' of gitlab.freedesktop.org:libinput/libinput 2018-07-20 08:37:47 +10:00
Peter Hutterer
33bbc4f645 tools: fix touch frame checks in the YAML verifier script
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-19 15:34:25 +10:00
Peter Hutterer
a3cc5f3f64 tools: always set the log handler for debug-events and debug-gui
This way errors are highlighted in red even without --verbose

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-19 14:10:32 +10:00
Peter Hutterer
c7a9b2064d tools: setenv the quirks dir when running from the build directory
Fixes #84

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-17 10:36:08 +10:00
Peter Hutterer
ad5d2fef72 tools: change prototype of the builddir lookup function
Only one place really needs the return argument, so we might as well just pass
the memory to be returned in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-17 10:36:08 +10:00
Greg V
f8b412052e Import versionsort implementation from musl for systems without versionsort
versionsort is a GNU extension, not available on *BSD systems.
2018-07-16 13:44:11 +03:00
Peter Hutterer
e6cad92005 Rename data/ to quirks/
A better, less ambiguous name than just "datadir"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-13 13:30:54 +10:00
Peter Hutterer
f4dc296247 quirks: remove the leftovers of the trackpoint range attribute
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:49:02 +10:00
Peter Hutterer
27f7a66de4 filter: add a trackpoint multiplier factor
Measuring the trackpoint range has not shown to be sufficient or precise
enough to be used as an ingredient for trackpoint acceleration. So let's just
switch back to a generic multiplier that we can apply to the input deltas do
undo any device-specific lack of scaling.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
1cc9f44e93 quirks: add quirks_get_double()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
0021f9e7a8 tools: make-ptraccel-graphs: drop an unnecessary outfile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
6480bfe14d tools: drop the special handling for trackpoint accel, not needed anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
fc92aaf545 tools: reduce the trackpoint gnuplot range to 0..1 units/ms
Anything above 1 unit/ms is high pressure. Though that depends on the
trackpoint range, so...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
5f9c985661 tools: fix units for trackpoint accel graph
We use speed now and trackpoints are in units/ms

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
6dca5df806 filter: make the trackpoint accel profile func the same prototype as the others
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
00fdbe3951 tools: don't add the debug behavior for release builds
When the meson build type is something other than the debug types, we don't
need the special behavior where we adjust executable paths and data dir
lookup for tools run directly from the builddir.

This avoids leaking the build dir into the final executables.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 13:27:15 +10:00
Peter Hutterer
6be9c3c84e tools: fake-build the other tools the same way as measure touchpad-tap
Doesn't actually do anything but this way they end up in the builddir and can
be picked up by ./builddir/libinput measure fuzz, etc.

And rename the source files to .py to signal that they are not supposed to be
directly executed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
2caf557e10 tools: rely on the libinput and quirks tool to pick the right directories
Don't use a custom hack here, just make sure the tool ends up in the builddir
so it's picked up by the libinput main tool.

This means the PATH isn't set up correctly when called directly
(./builddir/libinput-measure-touchpad-pressure) but the workaround is to
always use the libinput tool - just as we expect from users.

To make it more obvious that we're not supposed to run this directly, rename
the source file to .py

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
25a6535570 tools: quirks: if we're executing from the builddir, use the git datadir
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
7e7d657dab tools: if the execdir is the builddir, add it to the path
When running libinput tools from the builddir, look up the subtools in the
builddir as well. Otherwise, add the install prefix to the list of lookup
locations.

This ensures that a) we're running builddir stuff against builddir stuff, but
also b) that we're not running builddir stuff against installed stuff because
that may give us false positives.

The test was squashed in from a separate patch and was
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
e723398c14 tools: rename list-quirks to the more generic "quirks list"
Enables us to easily add more tools where needed and it is
more consistent with the existing tools.

The commands are now:
   libinput quirks list
   libinput quirks validate

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/66

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-03 15:16:59 +10:00
Peter Hutterer
4f5182c8b0 tools: add record/replay to --help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-27 15:40:13 +10:00
Peter Hutterer
ea5edf09c4 tools: libinput-record: print the list of quirks
Now that all device quirks are in the quirks subsystem we have to print those
instead of just the udev devices.

Since libinput-record is there to record system devices, the system-installed
quirk list is used (without any commandline overrides right now). This is
useful to capture misconfigurations or missing quirks on the host system.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/58

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 13:59:30 +10:00
Peter Hutterer
07e93f077e tools: move printing device quirks to the shared tools lib
This way we can re-use this from libinput-record instead of having to
duplicate all this. Since the two tools use different printfs, just make the
actual printing a simple callback.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 13:59:30 +10:00
Peter Hutterer
b049d6696d tools: fake-build the measure touch-pressure/size sources
This way we can make them execute the list-quirks from the builddir. And it
makes it easier to run these tools from the git directory on machines where we
have libinput without the quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 01:30:25 +00:00
Peter Hutterer
c20d50eb6f tools: libinput-replay: set INPUT_PROP_* properties on the device
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/60

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 15:02:20 +10:00
Peter Hutterer
8684900464 tools: libinput-record: use .yml suffix in the man page
Makes things easier when users save it as yml file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 15:02:20 +10:00