> ## 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.

# GAMEPAD_REPORT structure

> GAMEPAD_REPORT structure

# GAMEPAD\_REPORT structure

控制器状态的快照。

## 语法

```cpp theme={null}
typedef struct GAMEPAD_REPORT {
    UINT16 Buttons;
    UINT16 LeftTrigger;
    UINT16 RightTrigger;
    INT16 LeftThumbstickX;
    INT16 LeftThumbstickY;
    INT16 RightThumbstickX;
    INT16 RightThumbstickY;
} GAMEPAD_REPORT, *PGAMEPAD_REPORT;  
```

##### 成员

**Buttons**\
[GAMEPAD\_BUTTONS](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/enumerations/GAMEPAD_BUTTONS-typedef-xtfinput-xbox-windows-t.md) 标志值的组合，表示控制器上按钮的状态。

**LeftTrigger**\
介于 0 和 1023 之间的值，表示左扳机的按下程度。

**RightTrigger**\
介于 0 和 1023 之间的值，表示右扳机的按下程度。

**LeftThumbstickX**\
介于 -32768 和 32767 之间的值，表示左操纵杆在 x 轴上的位置。

**LeftThumbstickY**\
介于 -32768 和 32767 之间的值，表示左操纵杆在 y 轴上的位置。

**RightThumbstickX**\
介于 -32768 和 32767 之间的值，表示右操纵杆在 x 轴上的位置。

**RightThumbstickY**\
介于 -32768 和 32767 之间的值，表示右操纵杆在 y 轴上的位置。

## 备注

**GAMEPAD\_REPORT** 用于向开发主机发送模拟控制器的所需状态。你将使用 [IXtfInputClient::SendGamepadReport](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md) 将控制器的各个状态发送到主机。通过重复执行此操作，你可以在开发主机上模拟一系列控制器输入。你需要将游戏报告发送到由 [IXtfInputClient::ConnectGamepad](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md) 创建的虚拟控制器。

## 要求

**头文件：** xtfinput.h

**库：** xtfinput.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

## 另请参阅

[XtfInput](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)\
[IXtfInputClient::SendGamepadReport](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)\
[IXtfInputClient::ConnectGamepad](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)


## Related topics

- [XtfInput（API 内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)
- [GAMEPAD_REPORT_EX](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/structures/gamepad_report_ex.md)
- [SendGamepadReport](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [SendGamepadReportEx](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportex.md)
- [SendGamepadReportWithAudio](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportwithaudio.md)
