One of the bits we are currently finalising in libinput are touchpad gestures. Gestures on a normal touchscreens are left to the compositor and, in extension, to the client applications. Touchpad gestures are notably different though, they are bound to the location of the pointer or the keyboard focus (depending on the context) and they are less context-sensitive. Two fingers moving together on a touchscreen may be two windows being moved at the same time. On a touchpad however this is always a pinch.
Touchpad gestures are a lot more hardware-sensitive than touchscreens where we can just forward the touch points directly. On a touchpad we may have to consider software buttons or just HW-limitations of the touchpad. This prevents the implementation of touchpad gestures in a higher level - only libinput is aware of the location, size, etc. of software buttons.
Libinput uses the touchpad pressure values and/or touch size values to detect wether a finger has been placed on the touchpad. This is Information provided by the kernel and combines with a libinput-specific hardware database to adjust the thresholds on a per-device basis. Libinput uses these thresholds primarily to filter out accidental light. Thus, if a user puts down a fourth finger during a three-finger swipe gesture, libinput will end the three-finger gesture and, if applicable, start a four-finger swipe gesture. A caller may decide that those gestures are semantically identical and continue the two gestures as one single gesture. Many users use libinput-gestures already, and might have different gestures set up for what you coded, For example, I switch windows, not desktops, with 4 fingers horizontal swipes. Thus, 5.10 will break my workflow and that of many others. How do i enable touchpad gestures like in iOS? Posted by 1 year ago. How do i enable touchpad gestures like in iOS? HI i just installed this wonderful OS on a dell xps 13 and was wondering how i can enable 3 or 4 finger swype to different desktops like in iOS? I could not see an option from the settings menu. I have tested libinput-gestures. It supports gestures for touchpad with 3 and 4 fingers (swipe and pinch), and it works fine. I use it to open many effects like desktop-grid and windows-presentation. I can navigate through windows and virtual desktop too, with a simple gesture like swipe left or right with 3 fingers.
Hence - touchpad gestures in libinput. The tree is currently sitting here and is being rebased as we go along, but we're expecting to merge this into master soon.
The interface itself is fairly simple: any device that may send gestures will have the LIBINPUT_DEVICE_CAP_GESTURE capability set. This is currently only implemented for touchpads but there is the potential to support this on other devices too. Two gestures are supported: swipe and pinch (+rotate). Both come with a finger count and both follow a Start/Update/End cycle. Gestures have a finger count that remains the same for the gestures, so if you switch from a two-finger pinch to a three-finger pinch you will see one gesture end and the next one start. Note that how to deal with this is up to the caller - it may very well consider this the same gesture semantically.
Swipe gestures have delta coordinates (horizontally and vertically) of the logical center of the gesture, compared to the previous event. A pinch gesture has the delta coordinates too and a delta angle (clockwise, in degrees). A pinch gesture also has the notion of an absolute scale, the Begin event always has a scale of 1.0 and that changes as the fingers move towards each other further apart. A scale of 2.0 means they're now twice as far apart as originally.
Nothing overly exciting really, it's a simple API that provides a couple of basic elements of data. Once integrated into the desktop properly, it should provide for some improved navigation. OS X has had this for a log time now and it's only time we caught up.
Libinput Touchscreen
If you want to set-up touchpad gestures on Linux, but don’t know how, you should check out the following app.
The app is called ‘Gestures’ and is described by its developer as being a “minimal Gtk+ GUI app for libinput-gestures”.
Windows and macOS both come with a variety of useful touchpad gestures pre-configured out of the box, and offer easy-to-access settings for adjusting or changing gesture behaviour to your liking.
Alas Ubuntu, like many Linux distributions, is a little lacking in this regard. Only a handful of basic gestures for scrolling and right-click available out of the box on Ubuntu 18.04 LTS, for instance.
But by using the “Gestures” app you can quickly effect a set of custom trackpad gestures that are on par with other operating systems, and in some cases, far more useful!
Create Touchpad Gestures on Ubuntu
Gestures provides an easy-to-use graphical front-end to libinput-gestures, thus saving you the need to craft a bespoke libinput-gestures config file by hand (or browse around to find a pre-prepared one online).
You can quickly enable trackpad gestures on Ubuntu 18.04 and similar Linux distributions, all based on whether you swipe or pinch the touchpad; the direction you move in; and/or the number of fingers you use in the gesture.
For instance, you could create a custom gesture to trigger the GNOME Shell Activities Overlay when you swipe down with two fingers (using xdtool to bind the gesture to a keyboard shortcut).
Patternodes 2 2 8 x 2. You might also set up a custom trackpad gesture with a four finger pinch instantly opening the Nautilus file manager, launch Firefox, take a screenshot, or anything else you want.
How to Get Gestures
Libinput Three Finger Drag
You can learn more about Gestures over on its Gitlab page, linked below.
Libinput Gestures 2 Finger Swipe Tricks
There you’ll find a list of dependencies and build instructions for installing the app on your system:
Reading this post from Solus? Lucky you, as Gestures is available from the Solus repos.
Thanks K.