仅为特定设备创建 xorg 输入设备配置文件

Naf*_*Kay 4 xorg

我注意到在 Ubuntu 衍生产品上默认使用 Apple Magic Trackpad 存在一些问题。我发现解决方案在于对/etc/X11/xorg.conf.d/50-synaptic.conf(或/usr/share/X11/xorg.conf.d/50-synaptic.conf,但该文件建议您在前面提到的/etc路径中复制和编辑它)进行修改:

# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
#   Option "OptionName" "value"
#
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
      MatchDevicePath "/dev/input/event*"
      # Fix for trackpad sensitivity. 
      Option "VertResolution" "75"
      Option "HorizResolution" "75"
EndSection

Section "InputClass"
        Identifier "touchpad ignore duplicates"
        MatchIsTouchpad "on"
        MatchOS "Linux"
        MatchDevicePath "/dev/input/mouse*"
        Option "Ignore" "on"
EndSection
Run Code Online (Sandbox Code Playgroud)

上面的两个触控板分辨率选项很重要。我想要做的是创建一个针对 Apple Magic Trackpads的自定义配置文件,并将其作为上游补丁提交,以使人们的生活更轻松。如何将我的配置文件调整为更具体且仅针对 Apple Magic Trackpad?

小智 5

使用 找出设备的 USB ID lsusb。在您的配置中添加一行,其后MatchDevicePath "/dev/input/event*"包含MatchUSBID "4567:89ab"最后一个十六进制代码的位置lsusb

另请参阅 的文档xorg.conf.d(5)

  • 对不起。然后您可能可以在“lsinput”中看到供应商/产品对。它可能是“MatchUSBID“05ac:030e””,并且应该在蓝牙设备上工作,尽管名称如此。 (2认同)