Table of Contents

Enum GamepadButton

Namespace
MaaFramework.Binding
Assembly
MaaFramework.Binding.dll

Virtual gamepad button codes for click_key/key_down/key_up

Use these values with MaaControllerPostClickKey, MaaControllerPostKeyDown, MaaControllerPostKeyUp.

Values are based on XUSB (Xbox 360) button flags. DS4 face buttons are mapped to Xbox equivalents.

Xbox 360 buttons:

| Value   | Button              | Description            |
|---------|---------------------|------------------------|
| 0x1000  | A                   | A button               |
| 0x2000  | B                   | B button               |
| 0x4000  | X                   | X button               |
| 0x8000  | Y                   | Y button               |
| 0x0100  | LB (Left Shoulder)  | Left bumper            |
| 0x0200  | RB (Right Shoulder) | Right bumper           |
| 0x0040  | L_THUMB             | Left stick click       |
| 0x0080  | R_THUMB             | Right stick click      |
| 0x0010  | START               | Start button           |
| 0x0020  | BACK                | Back button            |
| 0x0400  | GUIDE               | Guide/Home button      |
| 0x0001  | DPAD_UP             | D-pad up               |
| 0x0002  | DPAD_DOWN           | D-pad down             |
| 0x0004  | DPAD_LEFT           | D-pad left             |
| 0x0008  | DPAD_RIGHT          | D-pad right            |

DualShock 4 buttons (aliases to Xbox buttons):

| Value   | Button    | Xbox Equivalent | Description               |
|---------|-----------|-----------------|---------------------------|
| 0x1000  | CROSS     | A                   | Cross (X) button          |
| 0x2000  | CIRCLE    | B                   | Circle button             |
| 0x4000  | SQUARE    | X                   | Square button             |
| 0x8000  | TRIANGLE  | Y                   | Triangle button           |
| 0x0100  | L1        | LB                  | L1 button                 |
| 0x0200  | R1        | RB                  | R1 button                 |
| 0x0040  | L3        | L_THUMB             | Left stick click          |
| 0x0080  | R3        | R_THUMB             | Right stick click         |
| 0x0010  | OPTIONS   | START               | Options button            |
| 0x0020  | SHARE     | BACK                | Share button              |
| 0x10000 | PS        | -                   | PS button (DS4 special)   |
| 0x20000 | TOUCHPAD  | -                   | Touchpad click (DS4 only) |
[Flags]
public enum GamepadButton : ulong

Fields

A = 4096
B = 8192
BACK = 32
CIRCLE = 8192
CROSS = 4096
DPAD_DOWN = 2
DPAD_LEFT = 4
DPAD_RIGHT = 8
DPAD_UP = 1
GUIDE = 1024
L1 = 256
L3 = 64
LB = 256
LEFT_THUMB = 64
OPTIONS = 16
PS = 65536
R1 = 512
R3 = 128
RB = 512
RIGHT_THUMB = 128
SHARE = 32
SQUARE = 16384
START = 16
TOUCHPAD = 131072
TRIANGLE = 32768
X = 16384
Y = 32768