Lua SDKAPI reference
key
key - Keyboard & actions#
Keyboard keys and game actions (abilities, movement, fire) as virtual-HID input.
key.tap#
key.tap(name, [ticks])
Pulse a key/action. Without an explicit tick count the assert lasts a randomized 2-5 ticks (never a metronome); an explicit count (max 120) is honored as given.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Action name - see Action names in the input guide. |
ticks | number | random 2-5 | Explicit assert duration in engine ticks. |
key.hold#
key.hold(name)
Hold a key/action for this frame - call every tick to keep it held.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Action name. |
key.release#
key.release(name)
Release a key/action immediately (clears pending taps and blocks for it).
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Action name. |
key.block#
key.block(name)
Force an action OFF this frame - wins over hold/tap from any script. Call every tick to suppress.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Action name. |
key.held#
key.held(name) → boolean
True while the real key/button is physically held. 'None' is never held.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Key name or 'Mouse1'..'Mouse5'. |
Last updated 2026-10-03