Commit graph

379 commits

Author SHA1 Message Date
Martin Wilck
198c53650a libinput-measure-trackpoint-range: minimum delta measurement
libinput-measure-trackpoint-range doesn't work well for ALPS
touchsticks that have minimum delta amplitude of ~8. Fix that
by analyzing min and max amplitude (radius) of the measured deltas,
and suggesting a high trackpoint range value if ALPS-typical behavior
is encountered. Also, suggest a different calibration procedure
to the user; rather then just calibrating quick movements, slow, gentle
movements should also be covered.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-25 16:29:20 +10:00
Martin Wilck
c08f2f8988 libinput-measure-trackpoint-range: fix typo
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-25 16:26:45 +10:00
Peter Hutterer
2167c3af05 Merge branch 'wip/custom-pointer-accel-revert' 2018-05-21 12:19:30 +10:00
Peter Hutterer
fbd284ec14 Merge branch 'wip/touchpad-pointer-accel-v7' 2018-05-21 12:19:17 +10:00
Peter Hutterer
4c31a1a285 tools: debug-gui: add some extra targets for pointer acceleration testing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:18:58 +10:00
Peter Hutterer
33162632cb Revert "Expose a custom acceleration profile"
This looked good on paper but clearly no-one (including myself) ever tested this
in a real-life situation or they would've noticed that the constant factor is
missing, causing a segfault on the first two-finger scroll event, touchpad
gesture or button scrolling.

Adding the constant factor makes the API much worse and the benefit is
unclear, so out of the window it goes. We can revisit this for libinput 1.12
but this isn't going to make the next release.

This reverts commit d8bd650540.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:15:25 +10:00
Peter Hutterer
3d6ccb57be tools: ptraccel-debug: fail for a sequence without events
Found by scan-build, running ptraccel-debug --mode=sequence --nevents=5
would use garbage custom_deltas.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 16:24:06 +10:00
Peter Hutterer
7ad3dcf939 tools: libinput-record: fix leaking memory in the error cases
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
db2d16bfce tools: ptraccel-debug: switch to a mode enum
Fixes the dead code issue introduced in
822c97a1c2, print_accel was always
true so the rest of the code never got triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
18498fcc49 tools: ptraccel-debug: match the help with the actual trackpoint range value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-15 14:53:51 +10:00
Peter Hutterer
3251ba2af0 touchpad: add a tool to measure the touchpad fuzz
Well, I say "measure" but really at this point it just reads the
properties/axes and then does it's best to auto-generate a hwdb entry that
matches the user's hardware and sets a fuzz value on the device. Ideally this
reduces the number of hand-holding required in bugzillas. There are plenty of
things that can go wrong, so our fallback is still to throw up our hands and
point to the documentation.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-15 13:51:33 +10:00
Peter Hutterer
c4a6137876 tools: fix an argument name for ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-11 11:45:53 +10:00
Peter Hutterer
651651f8a8 tools: fix pointer acceleration graphs generation script
We're printing most of those those as mm/s now, improve to use gnuplot for
loops, and a few other fixes. The low-dpi graph is still out of whack (or the
implementation is?), need to fix that separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-11 11:43:44 +10:00
Peter Hutterer
822c97a1c2 tools: switch the ptraccel-debug tool to report profile curves by default
This is virtually the only one that matters at this point, the others may help
but they're usually more confusing than helpful.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-10 15:47:37 +10:00
Peter Hutterer
b476345959 tools: libinput-record: print switch events in --with-libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 14:03:30 +10:00
Peter Hutterer
8bf2c5ae16 tools: libinput-record: print tablet events in --with-libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 13:39:44 +10:00
Peter Hutterer
d140bb7c2d tools: libinput-record: move the event time offset to the first place we get it
Leftover from a previous version where printing and handling an event was
identical. Now we may handle events but not actually print them until a bit
later, so other events may have a (wrong) zero timestamp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 12:20:03 +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 Hutterer
d8bd650540 Expose a custom acceleration profile
This adds a third profile to the available profiles to map device-specific
speed to an acceleration factor, fully defined by the caller.

There has been a consistent call for different acceleration profiles in
libinput, but very little specifics in what actually needs to be changed.
"faster horses" and whatnot (some notable exceptions in e.g. bug 101139).
Attempts to change the actual acceleration function will likely break things
for others.

This approach opens up the profile itself to a user-specific acceleration
curve. A caller can set an acceleration curve by defining a number of points
on that curve to map input speed to an output factor. That factor is applied
to the input delta.

libinput does relatively little besides mapping the deltas to the
device-specific speed, querying the curve for that speed and applying that
factor. The curve is device-specific, the input speed is in device units/ms.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-26 14:48:37 +10:00
Peter Hutterer
132001f3ea tools: fix the script to make ptraccel graphs for meson's builddir
Partial fix only because we can't guess the build dir, but at least it doesn't
complain about the missing script now. And no-one really needs to run this
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-26 14:02:18 +10:00
Peter Hutterer
2d845789a9 tools: yaml verifier: fix some flake8 warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 16:04:41 +10:00
Peter Hutterer
c819b4f956 tools: libinput-replay: handle a nonzero offset for the first event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 16:04:41 +10:00
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