如何重新映射鼠标中键以在 Ubuntu 20.04 中自动滚动到任意位置

如何重新映射鼠标中键以在 Ubuntu 20.04 中自动滚动到任意位置

我按照本中给出的说明进行操作回答。我按照说的做了。首先我xinput --list在终端运行并得到了这个

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ GamingMouseI Gaming Mouse Consumer Control    id=10   [slave  pointer  (2)]
⎜   ↳ GamingMouseI Gaming Mouse                 id=12   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=17   [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)]
    ↳ GamingMouseI Gaming Mouse                 id=9    [slave  keyboard (3)]
    ↳ GamingMouseI Gaming Mouse System Control  id=11   [slave  keyboard (3)]
    ↳ CHICONY HP Basic USB Keyboard             id=13   [slave  keyboard (3)]
    ↳ Lenovo EasyCamera: Lenovo EasyC           id=14   [slave  keyboard (3)]
    ↳ Ideapad extra buttons                     id=15   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=16   [slave  keyboard (3)]
    ↳ GamingMouseI Gaming Mouse Consumer Control    id=18   [slave  keyboard (3)]

我发现id=12这是我需要重新映射的设备。然后我使用了xinput --list-props 12这个设备的属性并得到了这个

Device 'GamingMouseI Gaming Mouse':
    Device Enabled (164):   1
    Coordinate Transformation Matrix (166): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (299):   0
    libinput Natural Scrolling Enabled Default (300):   0
    libinput Scroll Methods Available (303):    0, 0, 1
    libinput Scroll Method Enabled (304):   0, 0, 0
    libinput Scroll Method Enabled Default (305):   0, 0, 0
    libinput Button Scrolling Button (306): 2
    libinput Button Scrolling Button Default (307): 2
    libinput Middle Emulation Enabled (308):    0
    libinput Middle Emulation Enabled Default (309):    0
    libinput Accel Speed (310): 0.000000
    libinput Accel Speed Default (311): 0.000000
    libinput Accel Profiles Available (312):    1, 1
    libinput Accel Profile Enabled (313):   1, 0
    libinput Accel Profile Enabled Default (314):   1, 0
    libinput Left Handed Enabled (315): 0
    libinput Left Handed Enabled Default (316): 0
    libinput Send Events Modes Available (284): 1, 0
    libinput Send Events Mode Enabled (285):    0, 0
    libinput Send Events Mode Enabled Default (286):    0, 0
    Device Node (287):  "/dev/input/event7"
    Device Product ID (288):    6127, 24766
    libinput Drag Lock Buttons (301):   <no items>
    libinput Horizontal Scroll Enabled (302):   1

在这个回答,据说是这样的

您正在寻找的属性集是“Evdev Wheel Emulation”属性。

Evdev Wheel Emulation但我在设备属性列表中找不到任何调用的内容。我还用来xinput test 12识别鼠标中键(即button press 2)。我应该修改哪个属性才能使用鼠标中键进行自动滚动?

答案1

我用:

xinput

喜欢你的设备信息,但是:

xinput set-prop 'pointer:YOUR DEVICE NAME' "libinput Scroll Method Enabled" 0, 0, 1

我只是将其添加到启动文件或启动应用程序应用程序中。我这样做而不是 ID,因为我的设备 ID 有时会改变。

对于我的确切设备来说是:

xinput set-prop 'pointer:Maxwise Production (China) Enterprise LTD. AmazonBasics MMO Gaming Mouse' "libinput Scroll Method Enabled" 0, 0, 1

答案2

我相信 evdev 和 libinput 是两个不同的输入驱动程序。如果您转到 libinput 的手册页 (man libinput),它们会列出所有选项和属性。类似于: xinput set-prop“GamingMouseI 游戏鼠标”“libinput Middle Emulation Enabled”1

相关内容