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

> GAMEPAD_REPORT 結構

# GAMEPAD\_REPORT 結構

控制器狀態的快照。

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

## 需求

**標頭：** xtfinput.h

**程式庫：** xtfinput.lib

**支援的平台：** Windows (適用於 XBOX 主機工具)

## 另請參閱

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


## Related topics

- [GAMEPAD_REPORT structure](/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)
- [GAMEPAD_REPORT (estructura)](/es/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)
- [GAMEPAD_REPORT_EX](/reference/tools/xtf/xtfinput/structures/gamepad_report_ex.md)
- [GAMEPAD_REPORT 構造体](/ja-jp/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)
