> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GameInput 设备映射工具与测试指南

> GameInput 设备映射工具与测试指南

GameInput 设备映射工具可在 [GameInput GitHub 项目](https://github.com/microsoftconnect/GameInput)中获取，是一款供硬件开发人员测试 GameInput API 如何识别并映射其设备的实用程序。该工具提供了可视化界面，用于检查设备的输入报告，以及 API 生成的对应 GameInput 读取和设备信息。这些信息对于调试和验证新设备的行为，或理解现有设备如何被 GameInput 解释尤为有帮助。

由于通用 HID 设备可能被目标系统以多种方式解释，GameInput 依赖于内置在 Windows 注册表中的一系列设备映射扩展，可在 `HKLM\SOFTWARE\Microsoft\GameInputRedist` 中找到。Windows.Gaming.Input (WGI) API 共享这些映射，并针对 GameInput 提供额外扩展。有关详细信息，请参阅[游戏控制器的注册表数据](https://learn.microsoft.com/windows/uwp/gaming/registry-data-for-game-controllers)。GameInput 设备映射工具可让硬件开发人员为其设备生成这些映射，并实时测试。

启动该工具时，你可以选择一个已连接的游戏手柄配件。GameInput 会枚举所有启用 XInput 的设备，以及用途页为 0x0001（通用桌面控件）且用途为 0x0005（游戏手柄）或 0x0004（游戏杆）的 HID 设备。当你选择设备时，工具默认显示对应的 GameInput 读取和设备信息。

进入配置流程后，你可以从 Windows PC 上当前可用的任何配置（若有）继续，也可从此工具创建的现有注册表文件继续，或者从零开始。工具会引导你完成将设备的输入报告映射到诸如游戏手柄、飞行操纵杆、赛车方向盘和 UI 导航控制器等 GameInput 接口的过程。随后你可以将这些映射与设备专属的标签对齐，也可以默认使用 XInput 设备所用的标签。你还可以添加对高级功能（如触觉反馈和陀螺仪）的支持。最后，在提交更改前可实时测试所生成的映射。

该工具可将映射导出为文件。你可以手动将文件提交给 Microsoft 供审议（在 [GameInput NuGet 页面](https://www.nuget.org/packages/Microsoft.GameInput)使用 “Contact Owners” 链接），随驱动程序一起分发，或包含在应用程序的安装包中。

<a id="seealsoSection" />

## 另请参阅

[GameInput 概述](/build/core-features/common/input/overviews/input-overview)
[XInput 游戏控制器 API](https://learn.microsoft.com/windows/win32/api/_xinput/)
[Game Input Protocol (GIP) / XInputHID 驱动程序文档（下载）](https://aka.ms/gipdocs)
[游戏控制器的注册表数据](https://learn.microsoft.com/windows/uwp/gaming/registry-data-for-game-controllers)


## Related topics

- [面向硬件开发人员的 GameInput](/zh-CN/build/core-features/common/input/hardware/input-hardware-topics.md)
- [GameInput 硬件：力反馈、触觉与传感器](/zh-CN/build/core-features/common/input/hardware/index.md)
- [GameInput](/zh-CN/reference/input/gameinput/gameinput_members.md)
- [与不同 GameInput 设备类型交互](/zh-CN/build/core-features/common/input/hardware/input-hardware-interfaces.md)
- [GameInput 力反馈接口](/zh-CN/build/core-features/common/input/hardware/input-hardware-force-feedback.md)
