Commit graph

37 commits

Author SHA1 Message Date
Kim Lindberger
99334e11bf
Add quirk to control velocity averaging, disable it by default
libinput applies averaging to the velocity of most pointer devices. Averaging
the velocity makes the motion look smooth and may be of benefit to bad input
devices. For good devices, however, it comes at the unfortunate price of
decreased accuaracy.

This change turns velocity averaging off by default (sets ntrackers to 2 instead
of 16) and allows for it to be turned back on via a quirk, for bad devices which
require it.
2018-08-22 12:12:55 +02:00
Kim Lindberger
f82eeae299
tools: fix ptraccel-debug tool for the new trackpoint multiplier
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-22 11:18:05 +02:00
Peter Hutterer
6480bfe14d tools: drop the special handling for trackpoint accel, not needed anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
5f9c985661 tools: fix units for trackpoint accel graph
We use speed now and trackpoints are in units/ms

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
6dca5df806 filter: make the trackpoint accel profile func the same prototype as the others
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +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
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
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
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
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
Hans de Goede
c4857f01d8 touchpad: Enable timestamp smoothing support for bluetooth touchpads
Bluetooth wreaks havoc with the timestamp of the input events coming
from the touchpad, enable timestamp smoothing support to counter this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-01 16:42:19 +01:00
Peter Hutterer
87b5682824 filter: add a custom trackpoint accelerator
Switch to a pure factor with a max scaled after a function. The offset is just
0 now (will be removed eventually). Both are determined with a function based
on a linear/exponential regression of a sample set of data pairs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-20 11:53:01 +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
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
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
e1849b3e58 tools: allow filter-switching in ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-12 14:06:00 +10:00
Peter Hutterer
4c48b46d15 filter: revamp to create device-specific filters, rather than accel functions
The previous approach to pointer acceleration was to initialize the same
motion filter behavior but a different acceleration profile depending on the
hardware (the profile converts a speed to a multiplier for input deltas).

To be more flexible for hardware-specifics, change this into a set of specific
pointer acceleration init functions. This patch has no effective functional
changes, they're still all the same.

The acceleration functions are kept for direct access by the ptraccel-debug
tool.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-11 09:19:55 +10:00
Peter Hutterer
cbff01daf1 Revert "filter: move the pointer acceleration profiles back to units/ms"
This reverts commit 8a6825f160.

Aside from introducing bugs, this doesn't really help with anything, it adds a
requirement to rename everything to make clear where we're using µs and where
we're using ms and that just clutters up the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-11 08:35:47 +10:00
Peter Hutterer
8a6825f160 filter: move the pointer acceleration profiles back to units/ms
There is no need here to use µs since we're just handling speeds/thresholds,
not actual events where a ms granularity can be too high.

Moving back to ms lets us drop a bunch of zeroes that clutter up the code, and
since the acceleration functions are a bit magic anyway, having the various
1000.0 factors in there makes it even less obvious.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-03 11:19:54 +10:00
Peter Hutterer
424a172b1b tools: fix the velocity range for printing the ptraccel profile
Now using µs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-07-31 14:48:13 +10:00
Jonas Ådahl
aa5f55149b Change to micro seconds for measuring time internally
In order to provide higher precision event time stamps, change the
internal time measuring from milliseconds to microseconds.
Microseconds are chosen because it is the most fine grained time stamp
we can get from evdev.

The API is extended with high precision getters whenever the given
information is available.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-28 17:42:32 +08:00
Peter Hutterer
4df1a9b66e tools: add --dpi= arg to ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 13:03:43 +10:00
Peter Hutterer
40dab334ab filter: pass the DPI to the acceleration filter
Currently unused, but store the ratio of DPI:default DPI for later use.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 13:03:43 +10:00
Peter Hutterer
c902b37a8d tools: don't drop the accelerated deltas in ptraccel-debug
Leftover from the initial (out-of-tree) implementation where we updated motion
in place. That hasn't been true since libinput switched to type-safe
coordinates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-26 11:10:29 +10:00
Peter Hutterer
1f4dd9985a tools: drop superfluous linebreaks in ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-22 16:00:12 +10:00
Peter Hutterer
bc9f16b40e COPYING: Update boilerplate from MIT X11 to MIT Expat license
To quote Bryce Harrington from [1]:
"MIT has released software under several slightly different licenses,
including the old 'X11 License' or 'MIT License'.  Some code under this
license was in fact included in X.org's Xserver in the past.  However,
X.org now prefers the MIT Expat License as the standard (which,
confusingly, is also referred to as the 'MIT License').  See
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING

When Wayland started, it was Kristian Høgsberg's intent to license it
compatibly with X.org.  "I wanted Wayland to be usable (license-wise)
whereever X was usable."  But, the text of the older X11 License was
taken for Wayland, rather than X11's current standard.  This patch
corrects this by swapping in the intended text."

libinput is a fork of weston and thus inherited the original license intent
and the license boilerplate itself.

See this thread on wayland-devel here for a discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-May/022301.html

[1] http://lists.freedesktop.org/archives/wayland-devel/2015-June/022552.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
2015-06-16 14:36:04 +10:00
Peter Hutterer
0ca29c6ddc Add streq() helper to use instead of strcmp() == 0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-26 08:46:05 +10:00
Peter Hutterer
8ead828e6f Fix a couple of coding style issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-01 12:09:57 +10:00
Peter Hutterer
ae1ede741d tools: add a tool for printing pointer acceleration parameters
Prints the various pointer accel behaviors into a format understood by
gnuplot, which then provides prettiness.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-04-11 10:44:13 +10:00