> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/di-14-zhang-duo-mei-ti-he-wai-bu-she-bei/di-14.4-jie-ren-ji-shu-ru-she-bei.md).

# 14.4 人机输入设备

FreeBSD 原生支持 I²C 和 USB 接口的触摸板。本节介绍关闭触摸板的方法。

## 触摸板

### 关闭触摸板

如需关闭触摸板，首先需查找触摸板在 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 2（妙控板 2）基于 Force Touch 压力感应技术提供精确的操作体验。

在 FreeBSD 上，Apple 妙控板通过 USB 连接时，现代版本（15.0 及以上）由新的 HID 驱动栈（usbhid/hms）自动识别和支持，无需额外加载内核模块。

该触摸板需要配合 `libinput` 输入库使用，在 X Window（通过 xf86-input-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）驱动在多数架构的通用内核中默认编译进内核，同时也以可加载模块形式存在（如 `ukbd_load="YES"`）。在 15.0 版本之后，usbhid 驱动成为默认选择，其优先级高于传统的 ums 和 ukbd 驱动。

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

鉴于项目正在逐步迁移至新的 HID 驱动栈（hkbd/hms），此问题仍需进一步研究其根本原因，并应向 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
