Skip to content

touchpad: simplify linear acceleration profile for a more natural response

Yu-Ann Chen requested to merge red8012/libinput:master into main

Background

When coming from macOS to Fedora, I find it more difficult to use the trackpad to do text selection precisely. The cursor is moving too fast to let me select text at character level. However, if I reduce the touchpad speed in GNOME Settings, it becomes painfully slow to move the cursor across the screen. I tried both Flat and Adaptive profile, neither of them solves the aforementioned problem.

Cause

The cause is that the acceleration profile of libinput is very different from the ones on macOS and on Windows (of course I am unable to confirm what the profiles on those systems actually are, but they do feel very different from libinput's). As explain in the comment of touchpad_accel_profile_linear in filter-touchpad.c, libinput's profile looks like this:

	  accel
	 factor
           ^         ______
	   |        )
	   |  _____)
	   | /
	   |/
	   +-------------> speed in

The problems (in my opinion) are:

  1. The acceleration factor ramp up way too fast at low speed. This makes it difficult to control the cursor precisely to do things like selecting a single character.
  2. The acceleration factor suddenly stops ramping at a certain speed, making it feel unnatural.
  3. The acceleration factor suddenly starts to ramp again at a higher speed, making it feel unnatural.

Proposed Solution

Instead of the ramp-flat-curve-flat profile, use a smooth and monotonically increasing function.

factor = 0.2 * pow(speed_in, 0.55);

Benefits

  1. The new profile feels more similar to the ones on macOS and Windows. It makes people's lives easier when switching back and forth between Linux, macOS, and Windows.
  2. The new profile makes it easier to do text selections precisely at low speed, while maintain agility at high speed.
  3. The new profile feels more natural since its first derivative is continuous.
  4. The new profile is simpler and easier to understand / tune.

Related to: #350

Edited by Peter Hutterer

Merge request reports

Loading