Keyboard

Read keyboard key state for interactive control.

What it does

Keyboard reads the live state of one or more keyboard keys. Each monitored key gives four numbers: whether it is currently held down, a one-frame pulse the instant it goes down, a one-frame pulse the instant it comes back up, and how long in seconds it has been held. Number of Keys watches more than one key at once, each with its own picker and its own set of four outputs.

Being a live input, it updates every frame the graph is running rather than only when something upstream changes.

When to use it

ParameterTypeDefault
key_countNumber1

Gotchas

Where live keyboard state cannot be reached, for example in an offline render, every output reads zero instead of erroring. A graph that looks correct in the editor can still produce all-zero signals in that context.

Worked example

  1. Add a Keyboard node.

  2. Leave Number of Keys at 1 and set its key picker to "space".

  3. Wire the key_0 output (pressed state) into an effect's enable input, so the effect only runs while Space is held.

  4. Raise Number of Keys to add more keys: set a second slot to "arrow_up" and wire its just_pressed pulse to trigger a one-shot action.

See also

Gamepad Input · Pointer · MIDI Input · Numbers, signals & audio