.isKeyDown()

Description

isKeyDown checks if a specific key is currently being pressed. Returns true if the key is down, false otherwise.

Parameters

isKeyDown takes no parameters.

Usage On Strings

if "A".isKeyDown() (
  log "A key is being held down"
)

if "Space".isKeyDown() (
  log "Space bar is being held down"
)

if "ArrowLeft".isKeyDown() (
  log "Left arrow key is being held down"
)

// Common key names:
// - Letters: "A" through "Z"
// - Numbers: "0" through "9"
// - Special keys: "Space", "Enter", "Tab", "Shift", "Control", "Alt"
// - Arrow keys: "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"
// - Function keys: "F1" through "F12"

Last updated

Was this helpful?