Multi-touch gestures with native touchpad drivers on Linux

0
25
Multi-touch gestures with native touchpad drivers on Linux

Here we can see, “Multi-touch gestures with native touchpad drivers on Linux”

Syngestures, the userland multi-touch daemon, is now available.

The fragmentation of the ecosystem, with many different options claiming to get you from point a to somewhere in the vicinity of point b, each with its own subtle differences (and at least a few “gotchas”) along the way, is perhaps one of the most difficult aspects of setting up a Linux system for desktop/home use. For example, in 2020, you’d think there’d be an easy way to get a trackpad/touchpad up and running with multi-touch gesture support on par with Windows and macOS — after all, it’s been 12 years since Apple popularized multi-touch with the 2008 MacBook Air.

Also See:  Gmail Running Out of Space

In 2020, the state of Linux multi-touch input.

Unfortunately, it isn’t that easy. For a long time, xf86-input-Synaptics was the best and only way to get Linux to recognize and support the most common trackpads. Originally written to target Synaptics touchpads but later updated with support for many different devices, it was both the best and only way to get Linux to recognize and support the most common trackpads. Along the way to no longer being a Synaptics-only PS/2 touchpad driver, xf86-input-synaptics began to use the evdev Linux kernel input driver, which gave birth to the more generic input/mouse/touchpad xf86-input-evdev driver, which most distributions now use because it included some (limited) multi-touch gesture support and was viewed as the way forward. Then came Wayland, with its “let’s reinvent everything” mentality, which introduced libinput as another input device replacement abstraction. Libinput and its X11 integration, xf86-input-libinput, offered native support for touchpads and multi-touch gestures, promoting its superior abstraction because it could give a better multi-touch experience where its predecessors couldn’t.

While it’s true that libinput has gesture functionality out of the box, it’s a huge step back in terms of the real touchpad experience. It’s dreadful, as anyone who switched from xf86-input-synaptic to xf86-input-libinput will attest (or anyone who’s tried libinput on a laptop after using Windows or macOS). It feels like you’re either attempting to push the cursor through mud or pursuing Blinky, Pinky, Inky, and Clyde on the final level of PacMan and can’t keep up no matter how you alter it (unless perhaps if you have the exact make and model of touchpad the devs used). In the name of rewriting the stack and reinventing the wheel, libinput throws out the baby with the bathwater: the acceleration curves are extremely poor, the heuristics for determining acceleration give extremely unnatural results, and the entire experience makes one want never to try Linux on a laptop again.

Sidebar: if you haven’t already read it, Ted Selker explains the decade of effort that went into establishing IBM’s Trackpoint, as well as the laborious effort that goes into creating an input device (and associated driver/software) that is ergonomic, natural, intuitive, and user pleasant. Anyone considering rebuilding something as complicated and delicate as a touchpad driver should read this first before assuming they can do a better job and forcing their replacement on others.

I wondered how difficult it would be to simply add multi-touch gesture support to the synaptics input driver rather than risk making the same Wayland/libinput mistake (see XKCD #927). My ambitions were modest: with Firefox, having two-finger forward and backward swipe navigation would have sufficed.

Also See:  How to Use Touchpad Gestures for Windows 10

I expected to have to dig deep into the drivers to add support for multi-touch gestures, but it turned out to be a breeze. Because xf86-input-synaptics now uses libevdev under the hood, the driver-level support for reading multi-touch input from the trackpad is fully implemented, and it’s just being ignored. So it wasn’t long before I had a proof-of-concept that allowed the xf86-input-synaptics driver to handle cursor movements, acceleration, deceleration, etc. At the same time, a userland program/daemon monitored for and acted on multi-touch inputs (via the Linux multi-touch protocol).

Syngestures are a new type of gesture.

syngesture is a rust-powered userland daemon that adds the rudimentary multi-touch capability to the venerable xf86-input-synaptics driver supporting one, two, and three-finger gestures. Of course, it’s completely open-source and licensed under the MIT license.

It was created to scratch a personal itch, like many other solutions. Still, after hearing from others with similar complaints, I decided to add some polish (such as machine-wide and per-user config files and support for multiple devices with per-device configuration) to make it more useful to the open-source community large hopefully. As stated above, it was created as a replacement for libinput and was developed primarily for use with xf86-input-synaptics. Still, it should also function with xf86-input-evdev and other Linux Multi-Touch Protocol devices.

syngesture is open source and regarded ready for broad usage (except for distribution-specific packages and system integrations requiring manual configuration – such as initial device discovery – and deployment).

Conclusion

I hope you found this information helpful. Please fill out the form below if you have any questions or comments.

User Questions

1. What is the distinction between a touchscreen and a multi-touch screen?

Multi-touch, unlike single-touch, allows you to use two or more touch-based commands simultaneously. On the other hand, Capacitive touchscreen devices recognize the point of touch based on the electrical charge generated by the user. The human body generates a modest quantity of electricity that is perceptible.

2. In Linux, how can I add gestures to the touchpad?

  • Step 1: Using the PPA, install Touchégg Service in Ubuntu:
  • Step 2: Touché the Graphical Configuration tool.
  • Step 3: Turn on/off Multi-Touch Gestures.

3. What is the best way to receive motions on my touchpad?

Try out these motions on your Windows 10 laptop’s touchpad. First, choose an item: Use the touchpad to make a selection. Scroll: Slide two fingers horizontally or vertically across the touchpad. Place two fingers on the touchpad and pinch in or stretch out to zoom in or out.

Also See:  How to Make uBlock Origin Even Better at Ad Blocking in Firefox

4. Multitouch Gestures on Wayland : r/Fedora – Reddit

Multitouch Gestures on Wayland from Fedora

5. multi-touch touchscreen gesture support in KDE – Reddit

multi-touch touchscreen gesture support in KDE – waiting for QT6? from kde