Skip to content

Button

Namespace: CtrlDS4

enum Button : uint8_t

Digital controls of the controller.

The D-pad directions are buttons too, so they can be bound to pins like any other button. The library converts them to the D-pad position the DS4 reports, ignoring opposite directions pressed together.

L2 and R2 are not listed: they are analog triggers (see Trigger), and the library reports them as pressed from their analog value.

The enums of the library are unscoped on purpose, so their values read as CtrlDS4::Cross rather than CtrlDS4::Button::Cross. They share the namespace, so their value names must stay unique across all of them.

Values

Cross

Cross = 0

Bottom face button.

Circle

Circle = 1

Right face button.

Square

Square = 2

Left face button.

Triangle

Triangle = 3

Top face button.

L1

L1 = 4

Left shoulder button.

R1

R1 = 5

Right shoulder button.

L3

L3 = 6

Left stick click.

R3

R3 = 7

Right stick click.

Share

Share = 8

Share button, left of the touchpad.

Options

Options = 9

Options button, right of the touchpad.

PS

PS = 10

PlayStation button, below the touchpad.

Touchpad

Touchpad = 11

Touchpad click.

DPadUp

DPadUp = 12

D-pad up direction.

DPadDown

DPadDown = 13

D-pad down direction.

DPadLeft

DPadLeft = 14

D-pad left direction.

DPadRight

DPadRight = 15

D-pad right direction.