搜索

第 16 章 硬件配置

download PDF

16.1. 平板电脑

16.1.1. 为新平板添加支持

libwacom 是一个平板电脑信息客户端库,用于存储有关 Wacom 模型的数据。GNOME 中的 gnome-settings-daemon 组件和 Wacom Tablet 设置面板都使用这个库。
要将对新平板电脑的支持添加到 libwacom 中,必须创建一个新的平板电脑定义文件。平板电脑定义文件包含在 libwacom-data 软件包中。如果安装了此软件包,则平板电脑定义文件会在 /usr/share/libwacom/ 目录中本地可用。
要正确使用屏幕映射,对平板电脑的支持必须包含在 libwacom 数据库和 udev 规则文件中。
重要
libwacom 不支持设备的一个常见指示是它通常在 GNOME 会话中工作,但设备没有正确映射到屏幕上。

过程 16.1. 如何添加平板电脑描述

  1. 使用 libwacom-list-local-devices 工具列出 libwacom 识别的所有本地设备。
    如果您的设备没有被列出,但可作为内核中的事件设备(请参阅 /proc/bus/input/devices)和 X 会话(请参阅 xinput list),则 libwacom 的数据库中缺少该设备。
  2. 创建一个新的平板电脑定义文件。使用以下的 data/wacom.example ,并编辑相应的行。
    注意
    新的 .tablet 文件可能已经提供,因此先在 https://sourceforge.net/p/linuxwacom/libwacom/ci/master/tree/ 检查上游存储库。如果在列表中找到了您的平板电脑型号,只需将该文件复制到本地机器就可。
    # Example model file description for a tablet
    [Device]
    
    # The product is the product name announced by the kernel
    Product=Intuos 4 WL 6x9
    
    # Vendor name of this tablet
    Vendor=Wacom
    
    # DeviceMatch includes the bus (usb, serial), the vendor ID and the actual
    # product ID 
    DeviceMatch=usb:056a:00bc
    
    # Class of the tablet. Valid classes include Intuos3, Intuos4, Graphire, Bamboo, Cintiq
    Class=Intuos4
    
    # Exact model of the tablet, not including the size.
    Model=Intuos 4 Wireless
    
    # Width in inches, as advertised by the manufacturer
    Width=9
    
    # Height in inches, as advertised by the manufacturer
    Height=6
    
    # Optional features that this tablet supports
    # Some features are dependent on the actual tool used, e.g. not all styli
    # have an eraser and some styli have additional custom axes (e.g. the
    # airbrush pen). These features describe those available on the tablet.
    #
    # Features not set in a file default to false/0
    
    [Features]
    # This tablet supports styli (and erasers, if present on the actual stylus)
    Stylus=true
    
    # This tablet supports touch.
    Touch=false
    
    # This tablet has a touch ring (Intuos4 and Cintiq 24HD)
    Ring=true
    # This tablet has a second touch ring (Cintiq 24HD)
    Ring2=false
    
    # This tablet has a vertical/horizontal scroll strip
    VStrip=false
    HStrip=false
    
    # Number of buttons on the tablet
    Buttons=9
    
    # This tablet is built-in (most serial tablets, Cintiqs) 
    BuiltIn=false
  3. 添加和安装以 .tablet 为后缀的新文件:
    cp the-new-file.tablet /usr/share/libwacom/
    安装后,平板电脑是 libwacom 的数据库的一部分。然后,可通过 libwacom-list-local-devices 提供平板电脑。
  4. 创建包含以下内容的新文件 /etc/udev/rules/99-libwacom-override.rules,以便您的设置不会被覆盖:
    ACTION!="add|change", GOTO="libwacom_end"
    KERNEL!="event[0-9]*", GOTO="libwacom_end"
    
    [new tablet match entries go here]
    
    LABEL="libwacom_end"
    
  5. 重启您的系统。

16.1.2. Wacom 平板电脑配置存储在哪里?

您的 Wacom 平板电脑的配置保存在 GSettings 的 /org/gnome/settings-daemon/peripherals/wacom/machine-id-device-id 键中,其中 machine-id 是一个 D-Bus 机器 ID,而 device-id 是一个平板电脑设备 ID。平板电脑的配置模式是 org.gnome.settings-daemon.peripherals.wacom
同样,手写笔配置存储在 /org/gnome/settings-daemon/peripherals/wacom/device-id/tool-id 键中,其中 tool-id 是用于专业范畴的手写笔的标识符。对于不支持 tool-id 的消费者范畴,改为使用通用标识符。手写笔的配置模式是 org.gnome.settings-daemon.peripherals.wacom.stylus,橡皮擦 的配置模式是 org.gnome.settings-daemon.peripherals.wacom.eraser
要获得特定机器上使用的平板电脑配置路径的完整列表,您可以使用 gsd-list-wacom 工具,该工具由 gnome-settings-daemon-devel 软件包提供。
要验证系统中是否安装了 gnome-settings-daemon-devel 软件包,请确定系统已订阅 Optional 频道,并运行以下命令:
# yum install gnome-settings-daemon-devel
要了解如何将系统订阅到 Optional 频道,请阅读以下资源:
验证安装了该软件包后,请运行以下命令:
$ /usr/libexec/gsd-list-wacom
请注意,在配置路径中使用 machine-iddevice-idtool-id 允许按机器与独立的平板电脑配置共享主目录。

16.1.3.  在计算机之间共享主目录时,Wacom 设置仅适用于一台机器

这是因为您的 Wacom 平板电脑的 D-Bus 机器 ID(machine-id)包含在 /org/gnome/settings-daemon/peripherals/wacom/machine-id-device-id GSettings 键的配置路径中,该键存储了您的平板电脑设置。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.