7

I would like that my touchpad two fingers tap works as a mouse middle click on ubuntu 19.10.The default in Ubuntu is the three tap fingers but I prefer using two fingers.

This was pretty easy in my former laptop using synaptics driver options (as explained here https://askubuntu.com/a/156545/1035668), but it looks like this new laptop is using a different driver and I haven't been able to figure out how to configure it as I would like.

Here you have the output of xinput list:

xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ MSFT0001:02 06CB:CD3E Touchpad            id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=9    [slave  keyboard (3)]
    ↳ Ideapad extra buttons                     id=11   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]

The output of xinput list-props 10:

Device 'MSFT0001:02 06CB:CD3E Touchpad':
    Device Enabled (145):   1
    Coordinate Transformation Matrix (147): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Tapping Enabled (282): 1
    libinput Tapping Enabled Default (283): 0
    libinput Tapping Drag Enabled (284):    1
    libinput Tapping Drag Enabled Default (285):    1
    libinput Tapping Drag Lock Enabled (286):   0
    libinput Tapping Drag Lock Enabled Default (287):   0
    libinput Tapping Button Mapping Enabled (288):  1, 0
    libinput Tapping Button Mapping Default (289):  1, 0
    libinput Natural Scrolling Enabled (290):   0
    libinput Natural Scrolling Enabled Default (291):   0
    libinput Disable While Typing Enabled (292):    1
    libinput Disable While Typing Enabled Default (293):    1
    libinput Scroll Methods Available (294):    1, 1, 0
    libinput Scroll Method Enabled (295):   1, 0, 0
    libinput Scroll Method Enabled Default (296):   1, 0, 0
    libinput Click Methods Available (297): 1, 1
    libinput Click Method Enabled (298):    1, 0
    libinput Click Method Enabled Default (299):    1, 0
    libinput Middle Emulation Enabled (300):    0
    libinput Middle Emulation Enabled Default (301):    0
    libinput Accel Speed (302): 0.000000
    libinput Accel Speed Default (303): 0.000000
    libinput Left Handed Enabled (304): 0
    libinput Left Handed Enabled Default (305): 0
    libinput Send Events Modes Available (267): 1, 1
    libinput Send Events Mode Enabled (268):    0, 0
    libinput Send Events Mode Enabled Default (269):    0, 0
    Device Node (270):  "/dev/input/event6"
    Device Product ID (271):    1739, 52542
    libinput Drag Lock Buttons (306):   <no items>
    libinput Horizontal Scroll Enabled (307):   1```
Pilot6
  • 90,100
  • 91
  • 213
  • 324
Midder
  • 73

1 Answers1

9

You can add

Option "TappingButtonMap" "lmr"

to the touchpad section of /usr/share/X11/xorg.conf.d/40-libinput.conf file like this:

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

lmr means "left/middle/right". By default 3-finger tap is for a middle-click (lrm).

It will permanently set this option (after a reboot). You can also test it by setting a xinput option:

xinput set-prop 10 288 0 1 

This should have an effect right away, but won't survive a reboot.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • Thank you @Pilot6! That did the trick! – Midder Mar 01 '20 at 12:00
  • This also works on Lenovo ThinkPad 11e running ubuntu.18.04.4-desktop.amd64. Many thanks, glad to find this answer after searching through 50 web pages. – Arya Jun 19 '20 at 04:55
  • @Pilot6 The xinput method worked, but when I tried Option "TappingButtonMap" "llr" to make it permanent, it didn't work... By the way, I don't understand why they are supposed to do the same thing and what the last 2 values mean. – Sharcoux Jan 18 '23 at 22:40
  • llr is not a valid option. – Pilot6 Jan 19 '23 at 04:58
  • Ah ^^". But your explaination about "lmr" seemed straightforward. Then how can I map 1 finger to left click, 2 fingers to left click and 3 fingers to right click? – Sharcoux Jan 19 '23 at 14:18
  • You can't...... – Pilot6 Jan 19 '23 at 14:30
  • Would you be ok to give me just a bit more details on what xinput set-prop 10 288 0 1 exactly does? I understand the 10 and the 288, but I don't get the 0 1. – Sharcoux Jan 19 '23 at 20:39
  • You can ask a question. Comments is not a good place for it. – Pilot6 Jan 20 '23 at 12:08
  • I thought about that, but I wonder if it would not be better to detail a bit more the answer you propose, explaining the last part. I bet that I won't be the only one reading your answer and wondering what the xinput line is exactly doing – Sharcoux Jan 20 '23 at 16:15