API Reference › Input › Input.down
method

Input.down

Input.down(action: str) -> bool

Returns whether a named action is held on the frame last read by Input.poll — true when the polled key is one of the keys bound to the action. Use it for continuous input (move while held); for a one-shot press use Input.pressed. Reading an action rather than a key is what lets the same handler serve any binding.

Example

program Held {
  entry {
    Input.bind("up", 'w')
    Input.poll()
    if Input.down("up") { print(1) }
  }
}
← All symbols