如何在 ubuntu 19.10 中将触摸板两指点击配置为中键?使用libinput

Mid*_*der 7 touchpad libinput

我希望在 ubuntu 19.10 上,我的触摸板的两指轻击可以像鼠标中键一样工作。Ubuntu 中的默认设置是三指轻击,但我更喜欢使用两指。

这在我以前的笔记本电脑中使用突触驱动程序选项非常容易(如这里所解释的https://askubuntu.com/a/156545/1035668),但看起来这台新笔记本电脑使用的是不同的驱动程序,我无法弄清楚如何按照我的意愿配置它。

在这里你有输出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)]
Run Code Online (Sandbox Code Playgroud)

的输出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```
Run Code Online (Sandbox Code Playgroud)

Pil*_*ot6 7

你可以加

Option "TappingButtonMap" "lmr"
Run Code Online (Sandbox Code Playgroud)

/usr/share/X11/xorg.conf.d/40-libinput.conf文件的触摸板部分,如下所示:

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "TappingButtonMap" "lmr"
EndSection
Run Code Online (Sandbox Code Playgroud)

lmr意思是“左/中/右”。默认情况下,三指点击用于中键 (lrm)。

它将永久设置此选项(重新启动后)。您还可以通过设置一个xinput选项来测试它:

xinput set-prop 10 288 0 1 
Run Code Online (Sandbox Code Playgroud)

这应该会立即生效,但不会在重新启动后继续存在。