配置 evdev conf 以进行鼠标中键模拟

配置 evdev conf 以进行鼠标中键模拟

我正在尝试编辑我的 evdev 配置以模拟鼠标中键,同时单击鼠标左键和右键。这是我附加的内容/etc/X11/xorg.conf.d/10-evdev.conf,然后重新启动了我的机器。但这不起作用。你能看到我做错了什么吗?

Section "InputClass"
    Identifier "Logitech Mouse"
    MatchProduct "USB-PS/2 Optical Mouse"
    MatchVendor "Logitech"
    Option "Evdev Middle Button Emulation" "true"
EndSection

这是 xinput 列表的输出:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse           id=9    [slave  pointer  (2)]
⎜   ↳ AKKO AKKO 3084BT                          id=11   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                        id=14   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=15   [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)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ AKKO AKKO 3084BT                          id=10   [slave  keyboard (3)]
    ↳ HP HD Webcam [Fixed]                      id=12   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]
    ↳ HP Wireless hotkeys                       id=16   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=17   [slave  keyboard (3)]
    ↳ ACPI Virtual Keyboard Device              id=18   [slave  keyboard (3)]

答案1

您通过 xorg.conf.d 配置它的方法是绝对正确的。我不确定我的解决方案,但可能值得一试:

Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"

在“输入类”部分添加/替换上面的代码。 (更改标识符,添加其余部分)罗技有时可能会有所不同,但我使用这些参数成功解决了问题。

您的 Xorg.log.0 是否提供了有关您的脚本的任何线索?

如果一切失败,您可以创建一个执行您的命令的 systemd 服务:(这不是解决方案,而是解决方法):

[Unit]
Description="Middle mouse emulation

[Service]
Type=simple
ExecStart= xinput set-prop 9 "Evdev Middle Button Emulation" 1

[Install]
WantedBy=multi-user.target

启用该服务,它应该在您下次启动时运行...

答案2

解决方案:

添加以下内容至/etc/X11/xorg.conf.d/10-evdev.conf

Section "InputClass"
      Identifier "middle button emulation class"
      MatchIsPointer "on"        
      MatchDevicePath "/dev/input/event*"
      Option "Emulate3Buttons" "on"
      Driver "evdev"
EndSection

https://www.spinics.net/linux/fedora/fedora-users/msg472142.html

编辑:在最近的机器上“Emulate3DButtons 已更改为“MiddleEmulation”

https://forums.freebsd.org/threads/where-to-put-xorgs-emulate3button-these-days.88837/

相关内容