如何正确配置X11以使xinput属性永久存在?

如何正确配置X11以使xinput属性永久存在?

我正在尝试设置启用的“模拟中键单击属性”:


xinput set-prop "Logitech Gaming Mouse G402" "libinput Middle Emulation Enabled" 1

作为永久设置。

我试图通过配置 "/usr/share/X11/xorg.conf.d/" 来实现此目的。

目前我已经创建了一个文件,其中包含:

Section "InputClass"
    Identifier  "Mouse Middle click emulation"
    MatchIsPointer  "on"
    Option      "MiddleEmulation" "true"
    Driver      "libinput"
EndSection

理论上应该可以实现这一点。从我在日志中看到的内容来看,它至少被阅读了,但我不明白其中的大部分内容。

这是我在日志中读到的有关鼠标行为的内容:

[    38.435] (II) config/udev: Adding input device Logitech Gaming Mouse G402 (/dev/input/event2)
[    38.435] (**) Logitech Gaming Mouse G402: Applying InputClass "libinput pointer catchall"
[    38.435] (**) Logitech Gaming Mouse G402: Applying InputClass "Mouse Middle click emulation"
[    38.435] (II) Using input driver 'libinput' for 'Logitech Gaming Mouse G402'
[    38.435] (II) systemd-logind: got fd for /dev/input/event2 13:66 fd 44 paused 0
[    38.435] (**) Logitech Gaming Mouse G402: always reports core events
[    38.435] (**) Option "Device" "/dev/input/event2"
[    38.437] (II) event2  - Logitech Gaming Mouse G402: is tagged by udev as: Mouse
[    38.437] (II) event2  - Logitech Gaming Mouse G402: device set to 800 DPI
[    38.437] (II) event2  - Logitech Gaming Mouse G402: device is a pointer
[    38.437] (II) event2  - Logitech Gaming Mouse G402: device removed
[    38.437] (**) Option "MiddleEmulation" "true"
[    38.437] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:08.1/0000:2b:00.3/usb5/5-4/5-4.2/5-4.2:1.0/0003:046D:C07E.0003/input/input3/event2"
[    38.437] (II) XINPUT: Adding extended input device "Logitech Gaming Mouse G402" (type: MOUSE, id 8)
[    38.437] (**) Option "AccelerationScheme" "none"
[    38.437] (**) Logitech Gaming Mouse G402: (accel) selected scheme none/0
[    38.437] (**) Logitech Gaming Mouse G402: (accel) acceleration factor: 2.000
[    38.437] (**) Logitech Gaming Mouse G402: (accel) acceleration threshold: 4
[    38.438] (II) event2  - Logitech Gaming Mouse G402: is tagged by udev as: Mouse
[    38.438] (II) event2  - Logitech Gaming Mouse G402: device set to 800 DPI
[    38.438] (II) event2  - Logitech Gaming Mouse G402: device is a pointer
[    38.439] (II) config/udev: Adding input device Logitech Gaming Mouse G402 (/dev/input/mouse0)
[    38.439] (**) Logitech Gaming Mouse G402: Applying InputClass "Mouse Middle click emulation"
[    38.439] (II) Using input driver 'libinput' for 'Logitech Gaming Mouse G402'
[    38.439] (**) Logitech Gaming Mouse G402: always reports core events
[    38.439] (**) Option "Device" "/dev/input/mouse0"
[    38.439] (EE) xf86OpenSerial: Cannot open device /dev/input/mouse0
    Permission denied.
[    38.439] (II) mouse0: opening input device '/dev/input/mouse0' failed (Permission denied).
[    38.439] (II) mouse0  - failed to create input device '/dev/input/mouse0'.
[    38.439] (EE) libinput: Logitech Gaming Mouse G402: Failed to create a device for /dev/input/mouse0
[    38.439] (EE) PreInit returned 2 for "Logitech Gaming Mouse G402"
[    38.439] (II) UnloadModule: "libinput"
[    38.440] (II) config/udev: Adding input device Logitech Gaming Mouse G402 Keyboard (/dev/input/event3)
[    38.440] (**) Logitech Gaming Mouse G402 Keyboard: Applying InputClass "libinput keyboard catchall"
[    38.440] (II) Using input driver 'libinput' for 'Logitech Gaming Mouse G402 Keyboard'
[    38.441] (II) systemd-logind: got fd for /dev/input/event3 13:67 fd 45 paused 0
[    38.441] (**) Logitech Gaming Mouse G402 Keyboard: always reports core events
[    38.441] (**) Option "Device" "/dev/input/event3"
[    38.442] (II) event3  - Logitech Gaming Mouse G402 Keyboard: is tagged by udev as: Keyboard
[    38.442] (II) event3  - Logitech Gaming Mouse G402 Keyboard: device is a keyboard
[    38.443] (II) event3  - Logitech Gaming Mouse G402 Keyboard: device removed
[    38.443] (II) libinput: Logitech Gaming Mouse G402 Keyboard: needs a virtual subdevice
[    38.443] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:08.1/0000:2b:00.3/usb5/5-4/5-4.2/5-4.2:1.1/0003:046D:C07E.0004/input/input4/event3"
[    38.443] (II) XINPUT: Adding extended input device "Logitech Gaming Mouse G402 Keyboard" (type: MOUSE, id 9)
[    38.443] (**) Option "AccelerationScheme" "none"
[    38.443] (**) Logitech Gaming Mouse G402 Keyboard: (accel) selected scheme none/0
[    38.443] (**) Logitech Gaming Mouse G402 Keyboard: (accel) acceleration factor: 2.000
[    38.443] (**) Logitech Gaming Mouse G402 Keyboard: (accel) acceleration threshold: 4
[    38.444] (II) event3  - Logitech Gaming Mouse G402 Keyboard: is tagged by udev as: Keyboard
[    38.444] (II) event3  - Logitech Gaming Mouse G402 Keyboard: device is a keyboard

相关内容