> ## 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_BUTTONS Enumeration

> GAMEPAD_BUTTONS Enumeration

# GAMEPAD\_BUTTONS Enumeration

控制器按钮标识符标志。

**GAMEPAD\_BUTTONS** 值在 [GAMEPAD\_REPORT](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md) 中用于指示当前按下了哪些按钮。

## 语法

```cpp theme={null}
typedef enum GAMEPAD_BUTTONS
{
    RIGHT_THUMBSTICK = 0x8000,
    LEFT_THUMBSTICK = 0x4000,
    RIGHT_SHOULDER = 0x2000,
    LEFT_SHOULDER = 0x1000,
    DPAD_RIGHT = 0x800,
    DPAD_LEFT = 0x400,
    DPAD_DOWN = 0x200,
    DPAD_UP = 0x100,
    Y = 0x80,
    X = 0x40,
    B = 0x20,
    A = 0x10,
    VIEW = 0x8,
    MENU = 0x4,
    NEXUS = 0x2,
    ENROLL = 0x1,
    NONE = 0
} GAMEPAD_BUTTONS, *PGAMEPAD_BUTTONS;  
```

## 常量

| 常量 | 描述 |
| - | - |
| RIGHT\_THUMBSTICK | 右操纵杆 |
| LEFT\_THUMBSTICK | 左操纵杆 |
| RIGHT\_SHOULDER | 右肩键 |
| LEFT\_SHOULDER | 左肩键 |
| DPAD\_RIGHT | 方向键右按钮 |
| DPAD\_LEFT | 方向键左按钮 |
| DPAD\_DOWN | 方向键下按钮 |
| DPAD\_UP | 方向键上按钮。 |
| Y | Y 按钮 |
| X | X 按钮 |
| B | B 按钮 |
| A | A 按钮 |
| VIEW | 视图按钮 |
| MENU | 菜单按钮 |
| NEXUS | Nexus 按钮 |
| ENROLL | 注册按钮 |
| NONE | 指示当前未按下任何按钮的值。 |

## 备注

**GAMEPAD\_BUTTONS** 是一个标志枚举，因此可以将各值组合成表示同时按下多个按钮的单个值。**GAMEPAD\_BUTTONS** 是 [GAMEPAD\_REPORT](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md) 结构的成员。它与有关非按钮输入（例如扳机键和摇杆值）的附加信息相结合，用于表示游戏手柄输入设备的状态。这些状态使用 [IXtfInputClient](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/ixtfinputclient-xtfinput-xbox-windows-t.md) 发送到主机。

## 要求

**头文件：** xtfinput.h

**库：** xtfinput.lib

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

## 另请参阅

[XtfInput](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)\
[GAMEPAD\_REPORT](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)\
[IXtfInputClient](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/ixtfinputclient-xtfinput-xbox-windows-t.md)


## Related topics

- [XtfInput（API 内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n.md)
- [GAMEPAD_MORE_BUTTONS](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/enumerations/gamepad_more_buttons.md)
- [GameInputGamepadButtons](https://docs.xbox.com/zh-CN/reference/input/gameinput/enums/gameinputgamepadbuttons.md)
- [SendGamepadReport](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [GAMEPAD_REPORT structure](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfinput/structures/GAMEPAD_REPORT-xtfinput-xbox-windows-t.md)
