Skip to content

Swap Two- and Three-Finger Tap Actions in Ubuntu 24.04

This tutorial shows how to remap touchpad tapping, so you Ubuntu will use 2-finger tap on touchpad as middle click (or paste), and 3-finger tap as right-click action.

GNOME, the default desktop in Ubuntu, has switched to Wayland and is going to drop classic Xorg session, the old method to remap touchpad tap buttons does not work anymore. Here’s the new method to do the job in recent Ubuntu releases e.g., Ubuntu 24.04 and 25.04.

Option 1: For default GNOME Desktop (both Wayland & X11)

Recent GNOME desktop releases have a hidden option to remap touchpad tap buttons. So far, it only supports:

  • lrmleft/right/middle, the default behavior for 1-, 2-, and 3-finger tap.
  • lmrleft/middle/right for 1-, 2-, and 3-finger tap.

Meaning it only supports exchanging the 2-, and 3-finger tap actions. But, it works in both Wayland and Xorg session in my tests.

1. Configure via Graphical Tool

For graphical way, first search for and install “Dconf Editor” configuration tool from App Center (filter by Debian package).

Then, launch Dconf Editor and navigate to /org/gnome/desktop/peripherals/touchpad/tap-button-map.

Finally, turn off “Use default value”, select custom value “lmr” (left/middle/right) and click Apply!

2. Use gsettings command

If you’re OK with Linux command line, then press Ctrl+Alt+T to open terminal, and run the single command below to do the job:

gsettings set org.gnome.desktop.peripherals.touchpad tap-button-map "lmr"

The change applies immediately after running the command or configuring via Dconf Editor.

And, you may run the command below at anytime to restore the change:

gsettings reset org.gnome.desktop.peripherals.touchpad tap-button-map

Option 2: For other desktops with X11/Xorg session

Ubuntu flavors with other desktops, such as XUbuntu and Ubuntu MATE, are still using the classic Xorg session as default.

This method may NOT work if your desktop settings offers a configure option to do similar job.

This is ONLY tested in Linux Mint 22 Cinnamon, as I don’t have other Ubuntu flavor installed in physical machine.

1. In the case, you may press Ctrl+Alt+T to open terminal and run command to create a conf file and edit it:

sudo nano /etc/X11/xorg.conf.d/30-touchpad.conf

This command will create a custom 30-touchpad.conf file under xorg configuration directory, and edit with nano command line text editor that works in most Linux.

2. When file opens, paste the lines below:

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
    Option "TappingButtonMap" "lmr"
EndSection

Tips: there are 4 spaces at the beginning of each line (except the 1st and last lines).

It tells to enable tapping and map tapping buttons to lmr for touchpad device using libinput driver.

To be more accurate, you may run the command below to list devices:

libinput list-devices |grep Device

Then, replace “touchpad” in file content with your device name in output. And, remove MatchIsTouchpad "on" if its not a touchpad.

When done, press Ctrl+S to save file and Ctrl+X to exit nano text editor. Finally, log out and back in to apply change.

Exit mobile version