> ## 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 結構

> GAMEPAD_REPORT 結構

# GAMEPAD\_REPORT 結構

控制器狀態的快照。

## 語法

```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-TW/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-TW/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md) 將控制器的個別狀態傳送至主機。重複執行此動作，即可在開發主機上模擬一連串的控制器輸入。您需要將遊戲報告傳送至由 [IXtfInputClient::ConnectGamepad](https://docs.xbox.com/zh-TW/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-TW/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)\
[IXtfInputClient::SendGamepadReport](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)\
[IXtfInputClient::ConnectGamepad](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)


## Related topics

- [XtfInput (API 內容)](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)
- [GAMEPAD_BUTTONS 列舉](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/enumerations/GAMEPAD_BUTTONS-typedef-xtfinput-xbox-windows-t.md)
- [GAMEPAD_REPORT_EX](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/structures/gamepad_report_ex.md)
- [SendGamepadReport](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [SendGamepadReportEx](https://docs.xbox.com/zh-TW/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportex.md)
