API Reference › Input › Input.active
method

Input.active

Input.active(action: str) -> bool

Returns whether a named action is active this frame, reading the whole device layer: true if any of the action's bound keyboard keys is in the multi-key held-set or any bound gamepad button is down on pad 0. Unlike Input.down (which reads only the single per-frame key), this sees simultaneous holds (move and jump) and is device-agnostic. The frame loop commits the device layer automatically, so it reads live without a manual Input.poll.

Example

program Active {
  entry {
    Input.action("left", 'a')
    if Input.active("left") { print(1) }
  }
}
← All symbols