Commit graph

22 commits

Author SHA1 Message Date
Peter Hutterer
1150a8442f tools: display the discrete axis steps too
Draw a second smaller scroll bar that moves with every discrete step. For that
to work, we have to accumulate the value from the normal scroll events until
we get the first discrete one, then move up.

The value per discrete event changes depending on the click wheel angle, so we
can't just use discrete on its own if we want the two scroll bars aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
96a0e8ed66 tools: don't apply config options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-12-19 15:55:42 +10:00
Peter Hutterer
4e469291b1 tools: let debug-events take a device path
This is the most common use-case other than "all from udev", so let's just
parse a device path correctly without requiring --device.

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
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
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
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
0a13223c39 tools: fix grab argument passing for libinput debug-events
The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

https://gitlab.freedesktop.org/libinput/libinput/issues/26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 09:50:29 +10:00
Peter Hutterer
795657a0a1 tools: print the number of touches for touch devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 13:51:00 +10:00
Peter Seiderer
6ed8c64e92 tools: libinput-debug-events stop variable needs volatile
The stop variable set in the signal handler needs
volatile (and use the defined sig_atomic_t instead
of unsigned int).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-15 08:06:54 +10:00
Greg V
8adfac3975 Include stdarg.h where variadic functions are used
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-01 09:31:42 +10:00
Peter Hutterer
5acd5147a1 tools: add an extra linebreak before closing
Just puts the ^C from the Ctrl+C on a separate line to make it easier to spot

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-09 10:36:03 +10:00
Stefan Brüns
48fd22def7 tools: Handle LIBINPUT_SWITCH_TABLET_MODE
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-06 08:45:18 +10:00
Peter Hutterer
e242ad219a tools: remove a leftover debug printf statement
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 09:24:29 +10:00
Peter Hutterer
d1b7b6267c tools: split the configuration option parsing out
We had one shared parsing function for all config options so tools parse
options that don't actually make sense (e.g. --quiet or --show-keycodes for
libinput-list-devices).

This patch splits the actual libinput device configuration out and reshuffles
everything to make use of that. One large patch, because splitting this up is
more confusing than dumping it all.

This means the actual option parsing is partially duplicated between debug-gui
and debug-events but hey, not everything in life is perfect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-26 18:43:59 +10:00
Peter Hutterer
4508e29a47 tools: make the libinput tool usage static
This now makes the header obsolete too

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
2d42e87deb tools: tidy up the usage() for the tools a bit
Now that the debug-gui is a user-visible tool, make sure the usage reflects
the right command name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
e9fc59efc8 tools: switch the libinput tool to be an exec-ing tool
Chaining args together inside a single binary would be nice, but it gets nasty
quickly (as I found out adding 3, 4 extra commands). Switch over to using a
git-style exec-ing command where libinput merely changes argv[0] and then
executes whatever it assembled. And those binaries can hide in libexec so they
don't clutter up the global namespace.

This also makes it a lot easier to write man pages, adopt the same style as
git uses.

Compatibilty wrapper scripts are provided for libinput-list-devices and
libinput-debug events. These warn the user about the changed command, then
exec the new one. Expect these wrappers to be removed at some point in the
future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
f3107a78e0 tools: hook libinput-debug-events into the libinput tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-18 09:24:22 +10:00
Peter Hutterer
d2c7f73d6d tools: rename a source file to match the future common file name paradigm
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-18 09:24:14 +10:00
Renamed from tools/event-debug.c (Browse further)