Commit graph

15 commits

Author SHA1 Message Date
Yinon Burgansky
93135c2012 filter: add scroll movement type to the custom acceleration profile
Adds a dedicated scroll movement type to the custom acceleration profile.
Supported by physical mouse and touchpad.
Other profiles remain the same by using the same unaccelerated filter for the scroll filter.

Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
2023-02-24 13:01:34 +02:00
Tobias Bengfort
9bb2136bab filter: simplify speed_factor()
The `speed_factor()` formula is unnecessarily complex, The behavior that is described in the comment can be achieved with a simple power function.

And adjust the comment to explicitly state that 0.05 is the minimum.
2023-02-08 10:56:48 +00:00
Peter Hutterer
d199c6d8c1 filter: add helper functions to create/destroy a delta smoothener
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-17 10:51:33 +10:00
Peter Hutterer
fc1a28951a filter: constify the interfaces and make them static
No functional change

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
b6e1f5d120 filter: remove an unnecessary layer of indirection
This is a leftover from when some of the filter code was shared between
pointer acceleration methods (pre v1.11 or so). Now these functions are
duplicated across files, so both the names and what they do isn't
necessarily reflective anymore.

Let's drop one layer of indirection to make the code a bit easier to
understand.

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-09-08 09:03:15 +10:00
Peter Hutterer
1d0dbd2461 filter: correct comments about the threshold's unit
See d6e5313497 for confirmation that the
threshold is intended to be in mm/s, the comment here is simply a leftover from
earlier times when the acceleration method was using device-units only.

Fixes #585

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-03-16 06:03:56 +00:00
Peter Hutterer
2b33445bc9 touchpad: use the same speed for scrolling as the baseline of the accel curve
Scrolling and gestures use unaccelerated motion. The idea behind it was that
at least for the default speed setting of 0, the accelerated speed and
unaccelerated speed are identical where meaningful.

The touchpad speed curve has a plateau for 'normal' speeds (i.e. not very slow
and not very fast) where the acceleration factor is constant. This is the
reference factor that the unaccelerated motion should use as well.

Since the touchpad acceleration rework in d6e5313497 the reference factor is
0.9 * TP_MAGIC_SLOWDOWN (previously the factor was 1.0 * TP_MAGIC_SLOWDOWN)
and scroll motion is thus 10% faster than the pointer movement at the default
speeds. Let's fix this and let the two match up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-14 02:57:48 +00:00
Konstantin Kharlamov
23f7a2647d filter-touchpad.c: remove unused includes
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-09-12 09:36:40 +10:00
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
Peter Hutterer
d6e5313497 filter: improve touchpad acceleration
This seems to give me roughly the same behaviour as macos does on the default
0 speed setting.

* Default speed is lower than before by around 30% [1]
* Acceleration kicks in much sooner (130mm/s vs 250mm/s before)
* Acceleration kicks in slower at lower speeds, so the change from 130mm/s to
  150mm/s is less than that of 320mm/s to 350mm/s
* The effect of the speed setting is a wide-range constant (de|ac)celeration
  [2], which means:
  * The unaccelerated baseline up until the threshold now changes with the
    speed setting
  * The threshold is now the same for all speeds
  * The range of the speed setting should now easily cover all desired device
    speeds.
  * Acceleration is steeper at higher speeds
* Deceleration was left as-is.

[1] This may or may not fix the jumping pointer issues caused by the previous
high defaults. When you have high default acceleration you move the finger
slower. This slow movement caused some touchpads (mostly seen on Lenovos) to
create pointer jumps. These weren't seen on synaptics previously because of a
combination of higher user finger speed (thus not triggering the bug) or just
not being as obvious (2px jump vs 10 px jump).

[2] The speed setting is actually a curve, the closer you get to 1.0 the more
difference you see between two different values. The curve's points are:
-1/0, 0/1, 1/5, so the resolution is closer for slow speeds. We still have
double resolution on the setting though so you'll find what you want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:18:58 +10:00
Peter Hutterer
1bd5869f19 filter: duplicate the pointer_accelerator struct into the bits that use it
Yeah, it's duplication. But this way it's also separation and we can't
accidentally use the wrong struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 17:10:05 +10:00
Peter Hutterer
31a21c0028 filter: namespace the various trackers_* functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 17:01:03 +10:00
Peter Hutterer
f02c9b9734 filter: drop the ntrackers argument from init_trackers
Reduces the duplication, everyone uses the same value anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:42:58 +10:00
Peter Hutterer
cae84b84ae filter: tidy up the touchpad filter
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:33:56 +10:00
Peter Hutterer
b887353ab9 filter: split the touchpad acceleration code into a separate file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00