Annoying multitouch behavior Elantech touchpad on Linux Mint 20.2 Cinnamon

cinnamonlinux-mintmouse-gesturestouchpadxinput

Recently I installed Linux Mint 20.2 Cinnamon.
Touchpad multi finger behavior is strange and annoying. When I tap with two fingers exactly at the same time, it performs right click and if one of my fingers touch a little later than the other one, it performs middle click. Three finger tap doesn't work. Changing Click Actions in Mouse and Touchpad seems to have no effect. Currently I disabled Tap to click to prevent accidentally paste, closing tabs, opening links, etc. while performing Two-finger scrolling or tapping.

Here is output for $ xinput --list-props X command:

$ xinput --list-props 13
Device 'ETPS/2 Elantech Touchpad':
    Device Enabled (166):   1
    Coordinate Transformation Matrix (168): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Tapping Enabled (301): 1
    libinput Tapping Enabled Default (302): 0
    libinput Tapping Drag Enabled (303):    1
    libinput Tapping Drag Enabled Default (304):    1
    libinput Tapping Drag Lock Enabled (305):   0
    libinput Tapping Drag Lock Enabled Default (306):   0
    libinput Tapping Button Mapping Enabled (307):  1, 0
    libinput Tapping Button Mapping Default (308):  1, 0
    libinput Natural Scrolling Enabled (309):   1
    libinput Natural Scrolling Enabled Default (310):   0
    libinput Disable While Typing Enabled (311):    0
    libinput Disable While Typing Enabled Default (312):    1
    libinput Scroll Methods Available (313):    1, 1, 0
    libinput Scroll Method Enabled (314):   1, 0, 0
    libinput Scroll Method Enabled Default (315):   1, 0, 0
    libinput Accel Speed (316): 0.000000
    libinput Accel Speed Default (317): 0.000000
    libinput Left Handed Enabled (318): 0
    libinput Left Handed Enabled Default (319): 0
    libinput Send Events Modes Available (286): 1, 1
    libinput Send Events Mode Enabled (287):    0, 1
    libinput Send Events Mode Enabled Default (288):    0, 0
    Device Node (289):  "/dev/input/event5"
    Device Product ID (290):    2, 14
    libinput Drag Lock Buttons (320):   <no items>
    libinput Horizontal Scroll Enabled (321):   1

I tried to edit libinput Tapping Button Mapping Enabled (307) by $ xinput --set-prop 13 307 X Y. Changing it to 0 1 didn't have any effect. Other values return error.

In Windows touchpad behaves OK for two and three finger actions. I think Ubuntu and previous versions of Linux Mint were OK too. External mouse works well.

How should I set three fingers for middle click and two fingers just for right click? (or at least disable middle click for two fingers)

Best Answer

I totally disabled middle click:

xinput set-button-map <Touchpad ID> 1 0 3 4 5 6 7
                                      ^
                                Middle click

You can also swap right and middle click gestures:

xinput --set-prop <Touchpad ID> <Tapping Button Mapping Enabled ID>  0 1
Related Question