Ubuntu – Clickpad: how to right-click with both Two-Fingers and Area

18.04gnome-tweak-tooltouchpad

I've got a buttonless touchpad, so-called clickpad, and I want to be able to perform a right click by both tapping with two fingers and clicking in the right-bottom area. The gnome-tweak-tool allows me to change between these two behaviors but doesn't have the option to turn them on both at the same time.

I mostly use the two-finger tap for right-click, but in some applications I need to click-and-drag with the right or middle button. However the usual tap-tap-hold to emulate holding the mouse button only works with one finger, so it's not possible to use it to emulate holding of the right button.

I'm using Ubuntu 18.04 on XOrg.

Best Answer

I was able to achieve this by using the gnome-tweak-tool and enabling the area Mouse click emulation under the Keyboard & Mouse section.

Then I added a new file in /usr/share/X11/xorg.conf.d and named it 90-libinput-quirks.conf with the following content

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "True"
EndSection

The file name itself is somewhat important, it needs to start with a higher number than the libinput.conf file bundled with Ubuntu 18.04. Mine was named 40-libinput.conf so I named mine 90-libinput-quirks.conf to make sure it was loaded after, and thus overriding, the original config.

Alternatively you could just add the Option "Tapping" "True" to the section identifier Identifier "libinput touchpad catchall" just as above. Not sure if this file could be overwritten by something like an update, so I prefer the first approach.