← All scene elements
SCENE ELEMENT / 10

Keyboard input

Non-visual keyboard events and action hooks.

LIVE WEB PLAYER

See it respond.

The same raylib runtime, compiled to WebAssembly. Load this example, inject MQTT messages and watch its published events.

Loading WebAssembly…
MQTT I/O
Waiting for runtime…

The browser requires a user action before the scene is loaded. Click Load demo scene first. MQTT is emulated and never leaves this page. Shaders are disabled in the web build; GPIO is hardware-only.

Non-visual keyboard input. Emits ON on press and OFF on release, supports actions, and can drive an interactive dialog choice.

Configuration

FieldDescription
typekeypress
keyLetter, digit, arrow, SPACE, ENTER, ESC, F1…F12, KP_0…KP_9
on_press, on_releaseAction chains

Copy-and-paste JSON

json
{
  "type": "keypress",
  "id": "start_key",
  "key": "ENTER",
  "on_press": "interview_dialog.open('dialog-example.json')",
  "on_release": "status_text.set('Key released')"
}

MQTT

text
Published topic: ergs/rpi01/status/start_key
Press payload:   ON
Release payload: OFF

Keypress is an output source; it is not simulated through an MQTT input command.