Commit graph

357 commits

Author SHA1 Message Date
Peter Hutterer
aca0e3729a tools: libinput-record: add gesture support
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 16:04:41 +10:00
Peter Hutterer
da02cdffd4 tools: yaml verifier: allow for SYN_REPORT value 1
This is generated by the kernel's autorepeat code, see input_repeat_key() in
drivers/input/input.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 15:10:43 +10:00
Peter Hutterer
41704028d3 tools: yaml verifier: add POINTER_AXIS to allowed events types
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 15:10:15 +10:00
Peter Hutterer
b2fb2adefa Remove some duplicate empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-16 15:14:23 +10:00
Peter Hutterer
8a223e739b Drop the libinput-list-devices and libinput-debug-events compat scripts
Added in 1.8, let's drop them for 1.11

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-13 14:58:46 +10:00
Peter Hutterer
3ec8eb7f30 tools: fix switch case-statement indentation
We don't indent the 'case FOO:' lines in libinput

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-12 11:59:46 +10:00
Peter Hutterer
a59ce1c0c4 tools: fix man page for debug-events
click method is 'buttonareas', not just 'buttons'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-06 08:18:33 +10:00
Peter Hutterer
4ff5f02d9c tools: touchpad-pressure: init the lo/hi values correctly
From https://bugs.freedesktop.org/show_bug.cgi?id=105535

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-20 15:32:01 +10:00
Peter Hutterer
8b6d799510 tools: libinput-record: print the mouse and pointingstick udev properties
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-20 13:51:31 +10:00
Peter Hutterer
a1ba6186e7 tools: libinput-record: print a progress bar when recording to a file
To let users know something is happening.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-19 14:24:15 +10:00
Peter Hutterer
056a5eb64a tools: libinput-record: print a comment when the device is in a neutral state
Common problem: some touch sequence does something to confuse libinput but it
cannot easily be captureed. The result is a long sequence of touche that need
to be picked apart and isolated.

Print an easy-to-search  for message in the evdev output that signals that the
device touch state is now neutral (i.e. no finger down). Same can be achieved
by searching for BTN_TOOL_FINGER but that provides false positives for
switching between one and two fingers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-19 14:24:15 +10:00
Peter Hutterer
6e4c83636a tools: libinput-record: add support for printing libinput events
Collect libinput events together with the evdev events and print them to the
log. This makes it possible to debug the full behavior of a user's machine
rather than having to replay it with potential different race conditions/side
effects.

Example event output:
  - evdev:
    - [  2, 314443,   4,   4,    57] # EV_MSC / MSC_SCAN               57
    - [  2, 314443,   1,  57,     1] # EV_KEY / KEY_SPACE               1
    - [  2, 314443,   0,   0,     0] # ------------ SYN_REPORT (0) ---------- +87ms
    libinput:
    - {time: 2.314443, type: KEYBOARD_KEY, key: 57, state: pressed}
  - evdev:
    - [  2, 377203,   4,   4,    57] # EV_MSC / MSC_SCAN               57
    - [  2, 377203,   1,  57,     0] # EV_KEY / KEY_SPACE               0
    - [  2, 377203,   0,   0,     0] # ------------ SYN_REPORT (0) ---------- +63ms
    libinput:
    - {time: 2.377203, type: KEYBOARD_KEY, key: 57, state: released}

Note that the only way to know that events are within the same frame is to
check the timestamp. libinput keeps those intact which means we can tell that
if we just had an evdev frame with timestamp T and get a pointer motion with
timestamp T, that frame caused the motion event.

So far, only key, pointer and touch events are printed. We also
hardcode-enable tapping where available until we have options to enable this
on the commandline just because that's useful to have.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-19 14:24:15 +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
Peter Hutterer
e4ce6dfb0a tools: libinput-replay: only print the events in verbose mode
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-13 10:57:57 +10:00
Peter Hutterer
3b20f3d02b tools: libinput-record: add separate variable for the first device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-09 15:08:42 +10:00
Peter Hutterer
7dc52459b3 tools: libinput-record: drop unused 'print' argument
And rename the function for more clarity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-09 15:08:42 +10:00
Peter Hutterer
12410dfba4 tools: libinput-record: fix frame printing for multiple devices
The evdev events were just dumped into one big list instead of being split up
by frame.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-09 14:56:02 +10:00
Peter Hutterer
a6d03c9c8f tools: add a tool to verify the yaml output from libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-09 14:56:02 +10:00
Peter Hutterer
e9e134a18d tools: record udev properties in libinput-record
Only the ones we care about in libinput but for those it's handy to know which
ones are set (especially the LIBINPUT_MODEL ones).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-08 09:42:44 +10:00
Peter Hutterer
cd63ba2cc0 tools: add the git version in the libinput-record output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-06 14:22:30 +10:00
Peter Hutterer
223c914847 tools: remove a stray perror() in libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 12:51:27 +10:00
Peter Hutterer
f1c0f28bca tools: fix two scan-build errors in libinput-record
division by 0 and an unused variable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 12:48:48 +10:00
Peter Hutterer
b02579121b tools: add --all to libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 11:50:46 +10:00
Peter Hutterer
578151da61 tools: add a libinput-replay tool
Similar in style to evemu-play but parses the YAML printed by
libinput-record. Note that this tool requires python-libevdev which is a new
package and may not be packaged by your distribution. Install with pip3 or
alternatively, just ignore libinput-replay, it's a developer tool only anyway.

User-visible differences to evemu-play:
* supports replaying multiple devices at the same time.
* no replaying on a specific device, we can add this if we ever need it
* --verbose prints the event to stdout as we are replaying them. This is
  particularly useful on long recordings - once the bug occurs we can ctrl+c
  and match up the last few lines with the recordings file. This allows us to
  e.g. drop the rest of the file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 11:50:46 +10:00
Peter Hutterer
576f2ed2a7 tools: add a libinput-record tool
This is a tool that does effectively the same job as evemu-record.
evemu has two disadvantages: its API is clunky and hard to extend even for
simple features. And it has a custom file format that requires special
processing but is difficult to extend and hard to write manually. e.g. the
bitmasks require keeping a line number state to know which bit an entry refers
to.

libinput-record records the same data but the output is YAML. That can be
processed easier and extended in the future without breaking the parsing. We
can (in the future) also interleave the evemu output with libinput's debug
output, thus having a single file where the events can be compared and
analysed without the need for replaying.  Likewise, we can easily annotate the
file with parsable bits of information without having to shove all that into a
comment (like version numbers of libinput, kernel, etc).

User-visible differences to evemu-record:
* the output file requires an explicit -o or --output-file argument
* no evemu-describe equivalent, if you just want the description simply cancel
  before any events are sent
* to see key codes, a --show-keycodes flag must be supplied, otherwise all
  'normal' keys end up as KEY_A. This protects against inadvertent information
  leakage
* supports a --multiple option to record multiple devices simultaneously. All
  recordings have the same time offset, it is thus possible to reproduce bugs
  that depend on the interaction of more than one device.

And to answer the question of: why a printf-approach to writing out yaml
instead of a library, it's simply that we want to be able to have real-time
output of the recording.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 11:50:46 +10:00
Peter Hutterer
5b29be3998 tools: fix inverse up/down threshold handling in measure touch-size
https://bugs.freedesktop.org/show_bug.cgi?id=105264

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-27 15:17:39 +10:00
Peter Hutterer
59550ed21c tools: fix option parsing in libinput measure
Missing '+' in the optstring caused it to evaluate all options. If any
argument was passed to a subcommand, libinput-measure would throw an error and
exit.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-26 13:53:40 +10:00
Peter Hutterer
963a7600f1 tools: remove pressure copy/paste leftovers from measure touch-size
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-26 13:53:40 +10:00
Maxin B. John
920debffd7 libinput-measure-touchpad-tap: use /usr/bin/env to invoke python3
Tweak this python scripts to use '/usr/bin/env python3'

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-20 11:11:08 +10:00
Peter Hutterer
da94e4e603 Silence coverity warning about uninitialized entry
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-16 16:57:30 +10:00
Quentin Glidic
0843fa8e5e meson: Fix bindir usage in install script
Since the install script cannot know the correct bindir, just pass it
from Meson directly.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-16 16:57:30 +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
0b8372962b tools: print the device in all measure tools
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-30 14:26:43 +10:00
Peter Hutterer
d1146930da tools: print out the device used for measuring the trackpoint range
Suggested in https://bugs.freedesktop.org/show_bug.cgi?id=103947#c2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-29 14:16:03 +10:00
Peter Hutterer
ac1d5082fe tools: clarify PermissionError in measure-trackpoint-range
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-29 12:11:46 +10:00
Peter Hutterer
1b54b726f0 tools: fix dashes in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-27 13:04:33 +10:00
Peter Hutterer
fca003d305 tools: replace the tap time measuring tool with a python one
A lot easier to process data in python than in C.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Dima Ryazanov <dima@gmail.com>
Tested-By: Dima Ryazanov <dima@gmail.com>
2017-11-17 09:22:37 +10:00
Peter Hutterer
b170993b74 tools: fix typo in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-16 13:13:28 +10:00
Peter Hutterer
13c9ef07a2 man: add --enable-middlebutton to debug-events man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-15 13:33:11 +10:00
Peter Hutterer
5561108ac4 tools: fix two flake8-3 warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-14 12:04:27 +10:00
Peter Hutterer
67bfb5cf2e tools: handle missing evdev/pyudev modules with a better error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-14 12:04:27 +10:00
Peter Hutterer
92aa1d1418 tools: when the command isn't installed, print that
Makes it more user-friendly to be able to split the tools into multiple
packages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-09 15:17:37 +10:00
Peter Hutterer
be344a3afb tools: fix missing words in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-09 13:51:35 +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
Stefan Brüns
5ea84fa7da tools: Show gesture/switch capabilities in list-devices output
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:44:52 +10:00
Peter Hutterer
b9914ec279 tools: restore default permissions for a source file
This was accidentally made 755 as part of e9fc59efc8

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-10 08:05:40 +10:00
Peter Hutterer
5252fa5d88 tools: add --disable-sendevents option to the debug-events/debug-gui tools
Makes it possible to debug issues with sendevents.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-18 17:00:57 +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
f7cfc2bbbb tools: restore option handling for the debug gui
window_init zeroes out the struct and loses any option parsing done before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05 10:41:27 +10:00