{"id":49217,"date":"2025-07-03T13:48:26","date_gmt":"2025-07-03T13:48:26","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=49217"},"modified":"2025-07-03T13:48:26","modified_gmt":"2025-07-03T13:48:26","slug":"swap-two-and-three-finger-tap-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2025\/07\/swap-two-and-three-finger-tap-ubuntu-24-04\/","title":{"rendered":"Swap Two- and Three-Finger Tap Actions in Ubuntu 24.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-40004\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/05\/touchpad-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>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&#8217;s the new method to do the job in recent Ubuntu releases e.g., Ubuntu 24.04 and 25.04.<\/p>\n<p><!--more--><\/p>\n<h3>Option 1: For default GNOME Desktop (both Wayland &amp; X11)<\/h3>\n<p>Recent GNOME desktop releases have a hidden option to remap touchpad tap buttons. So far, it only supports:<\/p>\n<ul>\n<li><b>lrm<\/b> &#8211; <b>l<\/b>eft\/<b>r<\/b>ight\/<b>m<\/b>iddle, the default behavior for 1-, 2-, and 3-finger tap.<\/li>\n<li><b>lmr<\/b> &#8211; <b>l<\/b>eft\/<b>m<\/b>iddle\/<b>r<\/b>ight for 1-, 2-, and 3-finger tap.<\/li>\n<\/ul>\n<p>Meaning it only supports exchanging the 2-, and 3-finger tap actions. But, it <b>works in both Wayland and Xorg session<\/b> in my tests.<\/p>\n<p><b>1. Configure via Graphical Tool<\/b><\/p>\n<p>For graphical way, first search for and install &#8220;<b>Dconf Editor<\/b>&#8221; configuration tool from App Center (filter by Debian package).<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44523\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor-600x368.webp\" alt=\"\" width=\"600\" height=\"368\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor-600x368.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor-300x184.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor-768x472.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/10\/install-dconf-editor.webp 1104w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Then, launch Dconf Editor and navigate to <i>\/org\/gnome\/desktop\/peripherals\/touchpad\/tap-button-map<\/i>.<\/p>\n<p>Finally, turn off &#8220;Use default value&#8221;, select custom value &#8220;lmr&#8221; (left\/middle\/right) and click Apply!<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-49218\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap-700x448.webp\" alt=\"\" width=\"610\" height=\"390\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap-700x448.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap-300x192.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap-768x492.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/dconf-editor-tapmap.webp 1031w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2. Use gsettings command<\/b><\/p>\n<p>If you&#8217;re OK with Linux command line, then press <code>Ctrl+Alt+T<\/code> to open terminal, and run the single command below to do the job:<\/p>\n<pre>gsettings set org.gnome.desktop.peripherals.touchpad tap-button-map \"lmr\"<\/pre>\n<p>The change <b>applies immediately<\/b> after running the command or configuring via Dconf Editor.<\/p>\n<p>And, you may run the command below at anytime to <b>restore<\/b> the change:<\/p>\n<pre>gsettings reset org.gnome.desktop.peripherals.touchpad tap-button-map<\/pre>\n<h3>Option 2: For other desktops with X11\/Xorg session<\/h3>\n<p>Ubuntu flavors with other desktops, such as XUbuntu and Ubuntu MATE, are still using the classic Xorg session as default.<\/p>\n<p><b>This method may NOT work if your desktop settings offers a configure option to do similar job.<\/b><\/p>\n<p><b>This is ONLY tested in Linux Mint 22 Cinnamon, as I don&#8217;t have other Ubuntu flavor installed in physical machine.<\/b><\/p>\n<p>1. In the case, you may press <code>Ctrl+Alt+T<\/code> to open terminal and run command to create a conf file and edit it:<\/p>\n<pre>sudo nano \/etc\/X11\/xorg.conf.d\/30-touchpad.conf<\/pre>\n<p>This command will create a custom <code>30-touchpad.conf<\/code> file under xorg configuration directory, and edit with <code>nano<\/code> command line text editor that works in most Linux.<\/p>\n<p>2. When file opens, paste the lines below:<\/p>\n<pre>Section \"InputClass\"\r\n    Identifier \"touchpad\"\r\n    Driver \"libinput\"\r\n    MatchIsTouchpad \"on\"\r\n    Option \"Tapping\" \"on\"\r\n    Option \"TappingButtonMap\" \"lmr\"\r\nEndSection<\/pre>\n<p><i>Tips: there are 4 spaces at the beginning of each line (except the 1st and last lines).<\/i><\/p>\n<p>It tells to enable tapping and map tapping buttons to <code>lmr<\/code> for touchpad device using libinput driver.<\/p>\n<p>To be more accurate, you may run the command below to list devices:<\/p>\n<pre>libinput list-devices |grep Device<\/pre>\n<p>Then, replace &#8220;touchpad&#8221; in file content with your device name in output. And, remove <code>MatchIsTouchpad \"on\"<\/code> if its not a touchpad.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/mint-lmr.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-49219\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/mint-lmr.webp\" alt=\"\" width=\"654\" height=\"442\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/mint-lmr.webp 654w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2025\/07\/mint-lmr-300x203.webp 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>When done, press Ctrl+S to save file and Ctrl+X to exit nano text editor. Finally, <b>log out and back in<\/b> to apply change.<\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":40004,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1389],"class_list":["post-49217","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-touchpad"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/49217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=49217"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/49217\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/40004"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=49217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=49217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=49217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}