API Reference › Input › Input.pressed
method

Input.pressed

Input.pressed(action: str) -> bool

Returns whether a named action went down this frame — held on the frame last polled, but not on the one before — the edge you want for "press to jump / confirm / fire", where Input.down would retrigger every frame the key is held. Depends on the two most recent Input.poll calls, so poll once per frame.

Example

program Edge {
  entry {
    Input.bind("jump", ' ')
    Input.poll()
    if Input.pressed("jump") { print(1) }
  }
}
← All symbols