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

# XInputOnGameInput（API 内容）

> XInputOnGameInput

# XInputOnGameInput

Microsoft 游戏开发工具包 (GDK) 提供了头文件 XInputOnGameInput.h，其中包含基于 GameInput 的 XInput API 实现。我们建议直接移植到 GameInput，尤其是当你需要键盘和鼠标或其他输入设备时。不过，XInputOnGameInput 包装器可用于协助启动初始移植工作，而无需对现有 XInput 代码进行任何更改。

## 函数

| 函数 | 描述 |
| - | - |
| [XInputEnable](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputenable.md) | XInputEnable API 参考 |
| [XInputGetAudioDeviceIds](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetaudiodeviceids.md) | 检索连接到指定控制器的耳机上音频渲染和捕获设备的 ID。 |
| [XInputGetBatteryInformation](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetbatteryinformation.md) | 检索无线控制器的电池类型和充电状态。 |
| [XInputGetCapabilities](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetcapabilities.md) | 检索已连接控制器的功能和特性。 |
| [XInputGetDeviceId](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetdeviceid.md) | 检索指定控制器的设备 ID。 |
| [XInputGetKeystroke](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetkeystroke.md) | XInputGetKeystroke API 参考 |
| [XInputGetState](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetstate.md) | 检索指定控制器的当前状态。 |
| [XInputGetStateWithToken](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md) | 检索指定控制器的当前状态，并将其与 D3DX 帧管线令牌相关联。 |
| [XInputOnGameInputInitialize](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputongameinputinitialize.md) | XInputOnGameInputInitialize API 参考 |
| [XInputOnGameInputUninitialize](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputongameinputuninitialize.md) | XInputOnGameInputUninitialize API 参考 |
| [XInputSetState](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstate.md) | 将振动数据发送到指定的双电机控制器。 |
| [XInputSetStateEx](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputsetstateex.md) | 将振动数据发送到指定的控制器。支持较新控制器的四电机振动功能。 |

## 结构

| 结构 | 描述 |
| - | - |
| [XINPUT\_BATTERY\_INFORMATION](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_battery_information.md) | 描述电池的类型和充电状态。 |
| [XINPUT\_CAPABILITIES](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_capabilities.md) | XINPUT\_CAPABILITIES API 参考 |
| [XINPUT\_GAMEPAD](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_gamepad.md) | XINPUT\_GAMEPAD API 参考 |
| [XINPUT\_KEYSTROKE](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_keystroke.md) | 描述 XInputGetKeystroke 函数返回的击键数据。 |
| [XINPUT\_STATE](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_state.md) | 描述控制器的状态。 |
| [XINPUT\_VIBRATION](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_vibration.md) | 描述双电机控制器振动功能的电机速度。 |
| [XINPUT\_VIBRATION\_EX](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/structs/xinput_vibration_ex.md) | 描述四电机控制器振动功能的电机速度。 |

## 概念文档

* [从 XInput 移植到 GameInput](https://docs.xbox.com/zh-CN/build/core-features/common/input/porting/input-porting-xinput.md)

## 另请参阅

[输入 API 参考](https://docs.xbox.com/zh-CN/reference/input/gc-reference-input-toc.md)


## Related topics

- [从 XInput 移植到 GameInput](https://docs.xbox.com/zh-CN/build/core-features/common/input/porting/input-porting-xinput.md)
- [IGameInputRawDeviceReport（接口内容）](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)
- [XtfInput（API 内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)
- [输入 API 参考](https://docs.xbox.com/zh-CN/reference/input/gc-reference-input-toc.md)
- [XInputOnGameInputInitialize](https://docs.xbox.com/zh-CN/reference/input/xinputongameinput/functions/xinputongameinputinitialize.md)
