Button

:= [
    South,
    East,
    West,
    North,
    LeftShoulder,
    RightShoulder,
    LeftStick,
    RightStick,
    Start,
    Back,
    DpadUp,
    DpadDown,
    DpadLeft,
    DpadRight,
]

A gamepad button, named by its place on the pad, not by its label. South is the bottom face button: A on an Xbox pad, Cross on a PlayStation pad and B on a Switch pad. A Gamepad carries the code. Your game decides what a button means.

The triggers are not buttons. Read left_trigger and right_trigger.

code : Button -> U8

The code of a button, as a Gamepad carries it.

held : Gamepad, Button -> Bool

True while the button is down on this pad.

pressed : Gamepad, Button -> Bool

True in the first step after the button went down on this pad. A button tapped between two steps is pressed but not held.

held_any : Input, Button -> Bool

True while the button is down on any pad. For a game with one player.

pressed_any : Input, Button -> Bool

True when the button went down on any pad since the previous step.