Commit graph

264 commits

Author SHA1 Message Date
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
Peter Hutterer
86ead3a6ad tools: whitespace change
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:41 +10:00
Peter Hutterer
3be2a591a5 tools: local headers use quotes, not pointy brackets
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:37 +10:00
Peter Hutterer
ece26cfb70 tools: up the maximum velocity so the output graph shows the leveling off
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:25 +10:00
Peter Hutterer
f545cfa923 tools: support --help in the ptraccel-debug tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:22 +10:00
Peter Hutterer
35dae6bcc0 tools: make sure GCC_FLAGS is used in tools/
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:14 +10:00
Peter Hutterer
1e7281fe0a tools: include config.h in libinput-list-devices and ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:14 +10:00
Peter Hutterer
68513d040d tools: fix comment wording
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:13 +10:00
Peter Hutterer
952b562d0c tools: fix signed/unsigned comparison warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:13 +10:00
Peter Hutterer
6e1db369ee tools: fix prototype for tools_usage
../tools/shared.h:66:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void tools_usage();

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 08:06:27 +10:00
Peter Hutterer
ea7026b7c1 tools: don't define GNU_SOURCE if were including config.h anyway
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-12-01 11:06:52 +10:00
Peter Hutterer
cff370fcd0 tools: print pointer axis source in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-29 12:14:05 +10:00
Peter Hutterer
364621c001 tools: change --speed to --set-speed for consistency
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-29 12:13:23 +10:00
Peter Hutterer
ef2f95dfee Mark some internal log functions as printf-style function
Fixes the respective clang warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-25 10:00:58 +10:00
Eric Engestrom
9f11610eff tools: change pointer to void
This makes it clear that it's not meant to be dereferenced.

CC: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-16 08:27:49 +10:00
Peter Hutterer
b3e9303449 tools: prefix debug output with '-' on device changes
We print the sysname, but it's not always obvious when there's an event from
another device within the stream from another device. Prefix it so it's easier
to spot and search for.

See https://bugzilla.redhat.com/show_bug.cgi?id=1364850#c3 for an example of
how such an event can hide.

We only use last_device for comparing pointer values so we don't need a
reference to the device, it doesn't matter if the device itself goes out of
scope.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-08 15:56:15 +10:00
Peter Hutterer
59fac8e902 Add configurable button map to tappings
The previously hardcoded button map for tapping is 1/2/3 to LRM. But the
middle button is a common feature on the desktop (used for paste, most
prominently) and three-finger tapping is almost impossible to do reliably on
some touchpads (e.g. the T440 has a recognition rate of ~1 in 5).

Left and right buttons have a prominent physical position (either softbuttons
or physical buttons) so make the tap order configurable. Those that require
middle buttons reliably can use the [software] buttons for left/right and
2-finger tap for a middle button.

https://bugs.freedesktop.org/show_bug.cgi?id=96962

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:05:57 +10:00
Peter Hutterer
3c113111fa Remove LIBINPUT_EVENT_TABLET_PAD_MODE event
Unimplemented and it wasn't supposed to be in the series.

https://lists.freedesktop.org/archives/wayland-devel/2016-June/029376.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-07-11 11:00:51 +10:00
Peter Hutterer
35a6ebc536 Merge branch 'wip/tablet-pad-modes-v3' 2016-07-04 10:26:03 +10:00