Commit graph

282 commits

Author SHA1 Message Date
Peter Hutterer
44b9dca9d5 tools: update the publish-doc tool to use ninja
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-13 12:28:37 +10:00
Peter Hutterer
c837cf8d78 tools: free the tap data on error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-13 08:33:12 +10:00
Peter Hutterer
5ba30f7b42 tools: add missing toffset copy from src to dest while duplicating
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-13 08:31:15 +10:00
Peter Hutterer
50991bd0d0 tools: point out that measuring taps may be different to what libinput sees
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-09 15:00:36 +10:00
Peter Hutterer
ce12ea6f9a tools: fix linker error with the debug-gui
Make sure we link libudev into everything that requires it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-06 17:55:14 +10:00
Peter Hutterer
56ceac34d0 tools: link libinput.la for libshared.la
Hopefully fixes the Semaphore CI build failures, apparently things are a bit
more restrictive there than in Fedora 26.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-06 15:23:22 +10:00
Peter Hutterer
5d2959aef9 tools: escape all dashes in man pages (for commands and options)
Apparently the rule is that if a dash may end up being copy/pasted, it needs
to be escaped.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
6511154705 tools: man page cleanup - lowercase all command names
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
328bc99d3b tools: add "libinput measure touchpad-tap"
This is the first tool of many more to come to enable users to gather
information aobut their devices and/or usage of these devices. Previously,
these required the users to record events, submit them to a bugzilla, have me
run various scripts over it and then decree that the scripts have spoken.
Push some of this into the hands of the users so they can query the numbers
locally and start investigating (or at least get an idea of what's happening).

This tool measures the time deltas between touch up and touch down and prints
a basic summary, together with the ability to print a dat file with the data
for visualization by e.g. gnuplot. Eventually, more of the current analysis
scripts will be moved into this or other helpers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
758ffa9c8a tools: link to the online documentation from the libinput(1) man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +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
12a364a858 tools: Reinstate libshared.la and add it to meson.build too
Removed with commit 863fd1f0eb but now that we
exec each subcommand, the previous per-target compilation flags aren't needed
anymore. Build a static library to avoid rebuilding the source files for each
target.

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
a69294251d Fold the event-gui into the libinput tool
It's common enough for users to want to debug libinput behavior without
interference by the compositor or the X server. Being able to run a GUI
without having to compile from git is helpful.

Note that this changes --enable-event-gui autotools option to
--enable-debug-gui and the event-gui mesonconf option to debug-gui.

This also drops the standalone event-gui binary in both autotools and meson.

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
67000f1ae6 tools: drop event-debug
It's the same thing as libinput-debug-events and the newer "libinput
debug-events" command. The only reason it existed after we started providing
libinput-debug-events is the -no-install libtool flag that makes debugging
with gdb bearable.

Now that we're slowly moving to meson, this isn't needed anymore. If you want
to gdb directly in the source tree, build with meson.
Or use "libtool --mode=execute gdb" for an autotools build.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
d73f252f2a tools: fix minor coding style issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-26 11:15:13 +10:00
Peter Hutterer
fd4427e4ec tools: fix return codes on failure
Leftovers from an earlier version where we had booleans and more function
nesting in the mix. Fix to return integers, and also rename the function name
accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-26 11:15:01 +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
ed72e2bcfb tools: add a 'libinput' tool
This tool will eventually replace the different libinput tools we ship atm
with the various functionalities being commands to the single tool, rather
than multiple tools.

Right now, we still build both tools separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-18 09:24:18 +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
Peter Hutterer
863fd1f0eb tools: drop libshared.la
Include the source files directly, we'll need per-target compiler flags that
affect different tools differently in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-18 09:24:10 +10:00
Peter Hutterer
235001ce0b Include config.h from event-debug.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-12 12:47:20 +10:00
Peter Hutterer
411aaa8f92 Rename man pages to .1 suffix for meson's benefit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-04 13:49:37 +10:00
Peter Hutterer
60d3b6a8ed tools: update man page for debug-events --show-keycodes flag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 13:52:31 +10:00
Peter Hutterer
0f6877104e tools: fix typo in list-devices man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 13:50:28 +10:00
Peter Hutterer
0bd36f2542 test: add color to litest verbose output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
6ba530f2d8 tools: use 'required_argument'/'no_argument' for getopt_long
See the getopt_long example, makes the code more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-24 11:42:44 +10:00
Peter Hutterer
e3d04088bd tools: print axes, but not capabilities on proximity out
Print the axis values on proximity out because it a) ensures we have the right
values and b) makes the output better aligned with the proximity in, so it's
easier to spot in a log file. But don't print the tool capabilities because
they're unrelated to the prox out anyway and again it makes the output easier
to spot.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-22 10:48:43 +10:00
Peter Hutterer
07ce6c8954 tools: fix printing of tablet coordinates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-01 09:34:46 +10:00
Peter Hutterer
1798cbdcaa tools: fix two comment typos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-27 15:24:09 +10:00
Peter Hutterer
619db3b60e Merge branch 'wip/log-function-rework' 2017-02-27 11:27:41 +10:00
Peter Hutterer
38c675c959 tools: add mode group info to libinput-list-devices
We don't cater for the special case of groups having a different number of
modes, there is no hardware right now that does that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-27 09:36:37 +10:00
Peter Hutterer
451c6913e5 tools: add "--quiet" option to only log libinput messages
Supresses any printf statements from the tool itself, i.e. it skips printing
any of the events.

Makes it easier to debug the internal state since it's not intermixed with a
whole lot of messages about the events that are generated. Best combined with
--verbose (yes, hilarious, isn't it...)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2017-02-24 16:11:46 +10:00
Peter Hutterer
765ef9a31d tools: print accel profiles up to 1000 mm/s
The range that matters is 0-200, maybe up to 400 if you account for really
fast movements. But to match other, published, accel curves default to up to
1000 mm/s. It's easy enough in gnuplot to reduce the range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-21 15:05:07 +10:00
Peter Hutterer
a6b550cb78 tools: print the key as -1 for obfuscated keys
Missing from 8c1aa1de where we hid the human-readable parts but the keycode
itself is still enough information to recover the typed bits.
Print it as -1 as that keycode doesn't exist for real keys so it stands out
nicely.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-21 11:24:08 +10:00
Peter Hutterer
5515ecafec tools: size without decimals is good enough
Sub-mm precision isn't needed for libinput-list-devices' size field.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-20 12:11:26 +10:00
Peter Hutterer
92196ce555 tools: print errors as red, info as highlighted
makes it easier to filter out debugging messages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-15 09:29:39 +10:00
Peter Hutterer
63fcf46951 tools: don't print device options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-14 09:07:33 +10:00
Peter Hutterer
8c1aa1de00 tools: hide key codes by default
libinput-debug-events prints keycodes as they come in. This makes it dangerous
to be run by users (especially in the background) because it will leak
sensitive information as it is typed. Obfuscate the base set of keycodes
by default, require a --show-keycodes switch to show it.

The few times we actually need the keycodes, we can run the switch in the
debugging tool.

This does not affect keys outside of the main block on the keyboard (F-keys,
multimedia keys).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-14 07:53:22 +10:00
James Ye
1f0223e9fd Add a "switch" interface for parts of the SW_* range
This will allow switch devices known to libinput to be exposed. Currently,
this is SW_LID.

libinput also handles switch events internally, e.g. a laptop touchpad will
be disabled autmoatically when the lid is closed. This is transparent to
the caller, although the caller will also receive the event. See
https://bugs.freedesktop.org/show_bug.cgi?id=86223
This features is intended to be the main driver for the interface.

Co-Authored-By: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: James Ye <jye836@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 14:44:04 +10:00
Peter Hutterer
857411f84e Add wheel tilt as axis source
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-04 15:15:27 +10:00
Peter Hutterer
51e35d72ec tools: reduce some spacing to compress the output a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:32:51 +10:00
Peter Hutterer
589e320df6 tools: align device notify output better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:52 +10:00
Peter Hutterer
c92213e24c tools: size in mm is enough, no need for sub-mm precision here
Also changes from W/H to WxH format

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:48 +10:00
Peter Hutterer
16bf0deb23 tools: add allowed range to --set-speed help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 09:35:40 +10:00
Peter Hutterer
7e5062f632 doc: update the touchpad pointer acceleration svg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
ec63ecd485 tools: switch the ptraccel-debug printf to use mm/s
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
bdd4264d61 filter: change the filter functions to take raw device coordinates
We used to normalize all deltas to equivalents of a 1000dpi mouse before
passing it into the acceleration functions. This has a bunch of drawbacks, not
least that we already have to un-normalize back into device units for a few
devices already (trackpoints, tablet, low-dpi mice).

Switch the filter code over to use device units, relying on the dpi set
earlier during filter creation to convert to normalized. To make things easy,
the output of the filter code is still normalized data, i.e. data ready to be
handed to the libinput caller.

No effective functional changes. For touchpads, we still send normalized
coordinates (for now, anyway). For the various filter methods, we either drop
the places where we unnormalized before or we normalize where needed.

Two possible changes: for trackpoints and low-dpi mice we had a max dpi factor
of 1.0 before - now we don't anymore. This was only the case if a low-dpi
mouse had more than 1000dpi (never true) or a trackpoint had a const accel
lower than 1.0 (yeah, whatever).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
d1d3ea4d06 tools: add some extra help output about the expected input data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:44 +10:00