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

仅为特定设备创建 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

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

答案1

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

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

相关内容