Browse docsinput.held
On this page
API method

input.held

Returns true while a button is down.

Syntax

Atlas Script
input.held(button)

Parameters

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

Return value

Returns true while a button is down.

Remarks

Returns true while a button is down. A named trigger is held while its pressure is 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.