Browse docsinput.pressed
On this page
API method

input.pressed

Returns true for the controller packet where a button moves from up to down.

Syntax

Atlas Script
input.pressed(button)

Parameters

button
Controller button name or platform constant to read or change.

Return value

Returns true for the controller packet where a button moves from up to down.

Remarks

Returns true for the controller packet where a button moves from up to down. For a trigger name, the edge is 0 to greater than 0. Use a quoted name or a qualified name string such as ps5.l2; read the current numeric value with input.get(ps5.l2).

Examples

Pressed, held, and released.atlas
event on_input() {
    if (input.pressed("L1")) {
        system.log("L1 pressed");
    }
    if (input.held("L1")) {
        output.set_button("cross", true);
    }
    if (input.released("L1")) {
        system.log("L1 released");
    }
}
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.