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

# GAMEPAD_REPORT structure

> GAMEPAD_REPORT structure

# GAMEPAD\_REPORT structure

控制器状态的快照。

<a id="syntaxSection" />

## 语法

```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;  
```

<a id="ID4EG" />

##### 成员

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

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

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

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

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

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

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

<a id="requirements" />

## 备注

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

## 要求

**头文件：** xtfinput.h

**库：** xtfinput.lib

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

## 另请参阅

[XtfInput](/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n)\
[IXtfInputClient::SendGamepadReport](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m)\
[IXtfInputClient::ConnectGamepad](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m)


## Related topics

- [GAMEPAD_REPORT_EX](/zh-CN/reference/tools/xtf/xtfinput/structures/gamepad_report_ex.md)
- [IXtfInputClient::SendGamepadReport Method](/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::SendGamepadReportEx](/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportex.md)
- [IXtfInputClient::SendGamepadReportWithAudio](/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportwithaudio.md)
- [GAMEPAD_BUTTONS Enumeration](/zh-CN/reference/tools/xtf/xtfinput/enumerations/GAMEPAD_BUTTONS-typedef-xtfinput-xbox-windows-t.md)
