# 9.3 人机输入设备

FreeBSD 原生支持 I²C 和 USB 接口的触摸板。本节介绍关闭触摸板与调整 Synaptics 驱动反向滚动方向的方法。

## 触摸板

### 关闭触摸板

如需关闭触摸板，首先需查找触摸板在 X Window（X 窗口）系统中的设备标识。不同系统的设备名称可能不同，通常触摸板设备名称中会包含 `Touchpad` 或类似标识：

```sh
$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Windows pointer                         	id=6	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Windows keyboard                        	id=7	[slave  keyboard (3)]
```

找到触摸板对应的设备 ID（示例中为 6）后，关闭方式如下（其中 `1` 表示开启，`0` 表示关闭）：

```sh
$ xinput set-prop 6 "Device Enabled" 0    # 禁用 ID 为 6 的输入设备
```

#### 参考文献

* fygar256. FreeBSDタッチパッドをoffにする\[EB/OL]. Qiita, (2023-03-16)\[2026-03-25]. <https://qiita.com/fygar256/items/35100d43b096470631d6>. 详细介绍使用 xinput 工具禁用 FreeBSD 触摸板的方法，提供实用命令示例。

### Apple Magic Trackpad

Apple Magic Trackpad（妙控板）触摸板系列基于压力感应技术提供精确的操作体验。

FreeBSD 操作系统支持 Apple 妙控板硬件，但需要加载 `bcm5974` 内核模块才能正常启用其功能：

```sh
# kldload bcm5974
```

测试妙控板可正常使用后，将内核模块 `bcm5974` 加入系统开机自动加载列表，以确保每次启动后都能自动加载该驱动：

```sh
# sysrc kld_list+="bcm5974"
```

该触摸板需要配合 `libinput` 输入库使用，在加载内核模块之后，通常在 Wayland 桌面环境下可直接使用。目前暂不支持通过蓝牙无线方式使用。

## 附录：解决 15.0 及更高版本中键鼠无法驱动的问题

如果 USB 键盘、鼠标或触摸板在 15.0 以下版本中工作正常，但在系统更新到 15.0 后发生驱动故障，可参考以下解决方案：

在系统启动配置文件 **/boot/loader.conf.local** 中加入如下一行配置：

```ini
hw.usb.usbhid.enable="0"
```

该配置禁用 usbhid 驱动栈以回退至旧驱动，随后重启系统即可。

问题分析：ums（USB Mouse）和 ukbd（USB Keyboard）驱动始终存在于各架构的通用内核中。在 15.0 版本之后，usbhid 驱动成为默认选择，其优先级高于传统的 ums 和 ukbd 驱动。注意，两者均为直接编译进内核的驱动，而非以可加载模块形式存在。

usbhid 驱动最早出现于 FreeBSD 13.0。[FreeBSD 代码审查 D45658](https://reviews.freebsd.org/D45658) 将 hkbd、hms、usbhid 和 hidbus 等新 HID 栈设备加入各架构的 GENERIC 内核配置，而将 `hw.usb.usbhid.enable` 默认值由 0 改为 1 的变更出现在 [D45659](https://reviews.freebsd.org/D45659)。usbhid 自 15.0 起成为系统默认启用的驱动。

鉴于项目计划在未来版本中彻底移除 ums 驱动支持，此问题仍需进一步研究其根本原因，并应向 FreeBSD 项目提交 Bug 报告。具体可参考 FreeBSD 期刊 2021/0708 期的相关报道。

## 附录：Fn 键设置

* David Schlachter. Adjusting acpi\_video brightness increments on FreeBSD\[EB/OL]. (2020-03-12)\[2026-03-25]. <https://www.davidschlachter.com/misc/freebsd-acpi_video-thinkpad-display-brightness>. 介绍在 FreeBSD 上调整 ACPI 视频亮度增量的具体方法，适用于 ThinkPad 等笔记本电脑。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/di-9-zhang-duo-mei-ti-he-wai-bu-she-bei/di-9.3-jie-ren-ji-shu-ru-she-bei.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
