My touchdpad has two buttons (not tapping) and I used to configure two-finger tapping as middle click with synclient.

Now, with ubuntu-gnome 16.10, libinput is the way to go and I tried to achieve the same without success until now.

I tried the approaches mentioned in https://wiki.archlinux.org/index.php/Libinput. I have a file /etc/X11/xorg.conf.d/30-touchpad.conf with

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

which does not have effect. I can use

Option "ButtonMapping" "1 3 2 4 5 6 7 8 9 10 11"

Then two-finger-tap works for middle click, but the real right button will be a middle-click, too. I also tried a set of scripts and gnome configurations without success until now. Is there any solution with libinput, or do I have to switch back to synclient?

Any help appreciated.


As you have already discovered, the option you want is TappingButtonMap.

Option "TappingButtonMap" "lmr"

The issue is seemingly that Ubuntu 16.10 ships with version 0.19.0 of xserver-xorg-input-libinput. The property you (and I) want was added in a later version. Version 0.23.0-1 that ships in the development version of 17.04 supports it according to the documentation.


| improve this answer | |
  • No problem. I was looking for the same thing and your question saved me from messing needlessly with the button mappings. I need to use libinput to have working palm rejection/detection on my Dell Precision M5510 work laptop so I can't really use the Synaptics driver where remapping the buttons worked just fine. If you have a touchpad that supposedly works well with that driver you could give that a try. – blunden Feb 24 '17 at 16:47
  • @blunden A good answer +1 – Pilot6 Feb 24 '17 at 18:14
  • It is possible to install libinput from source. See askubuntu.com/a/651008/167850 – Pilot6 Feb 24 '17 at 18:16
  • @Pilot6 Yes, I am considering doing so myself to be able to use the supposedly better acceleration code in libinput 1.6 and later versions (as well as to be able to remap the taps). In that case, I intend to follow your instructions but probably use 'checkinstall,' both to get deb packages and for easier removal than what you get with "make install". – blunden Feb 26 '17 at 10:48
  • @Pilot6 I tried it now and the two projects built and installed without errors. However, when booting up I lost all input (keyboard and touchpad) because the broken libinput took over. I had to boot an Ubuntu live image, mount my encrypted drive and remove /usr/share/X11/xorg.conf.d/40-libinput.conf and my custom config in /etc to get it back. I then tried a clean build without checkinstall where I followed your instructions completely (besides using "1.6-branch" instead of master for libinput). Obviously I don't blame you but I was wondering if you have tried building libinput recently? – blunden Feb 26 '17 at 13:41

Besides the xorg.conf option in blunden's answer above,

Option "TappingButtonMap" "lmr"

you can also manually set it as

xinput set-prop $ID "libinput Tapping Button Mapping Enabled" 0, 1

for "lmr" or 1, 0, where $ID is the device id. Found the man pages of libinput, link.

| improve this answer | |
  • I'd upvote your answer 10 times if I could, for the xinput command sample. – arrowd 2 days ago

libinput in xenial and yakkety does not have the TappingButtonMap option.

You can use ButtonMapping, but as you noticed the physical buttons will be remapped too.

You can always revert to synaptics by

sudo apt remove xserver-xorg-input-libinput

You can also install a newer version of libinput that does support ButtonMapping. See THIS ANSWER for how-to.

| improve this answer | |
  • Thus, the documentation for wiki.archlinux.org/index.php/Libinput#Button_re-mapping is a bit confusing, right? I don't find the hint that these options only work with synaptics. In the opposite, they mention libinput as drop-in replacement for synaptics. – Micha Feb 12 '17 at 11:28
  • This option will work with a new version of libinput. – Pilot6 Feb 25 '17 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.