Keyboard

Category: Listener Tier: Basic

Purpose

Detects keyboard input with trigger modes, pulse detection, modifier key requirements, and inversion.

Visual Reference

As added to your scene
Keyboard brick as it appears in the GDLink editor

When To Use

  • Player movement (WASD keys, trigger_mode=While Held)

  • Jump mechanics (Space with trigger_mode=On Press)

  • Menu hotkeys (F1 for inventory, Escape for pause)

  • Debug commands (Ctrl+D for debug overlay)

  • Alternative controls (invert=true for “do X when key NOT pressed”)

Runtime Behavior

Triggers: When the specified key is pressed/held/released, with optional modifier key requirements

Generated UI Mockup — showing expanded properties
Keyboard
-
x
Name:
Label this brick...
Key:
W
Press...
Trigger:
While Held
Expose Scope:
Local
Expose Prefix:
keyboard
v
Pulse
Shift
Ctrl
Alt
Expose Data
Invert

Properties

Property

Type

Default

Notes

Key

key_capture

W

Press to capture any keyboard key

Trigger

option

While Held

When to trigger

Pulse

bool

False

Use pulse detection (True) or physical key detection (False)

Invert

bool

False

Trigger when key is NOT pressed

Shift

bool

False

Require Shift key held

Ctrl

bool

False

Require Ctrl key held

Alt

bool

False

Require Alt key held

Expose Data

bool

False

Write key name, pressed state, and modifier info into variables when the listener fires

Expose Scope

option

Local

Where exposed keyboard variables are written

Key Var

variable_name

Variable that receives the configured key name

Pressed Var

variable_name

Variable that receives whether the key is currently pressed

Mods Var

variable_name

Variable that receives held modifier names

Shift Var

variable_name

Variable that receives Shift state

Ctrl Var

variable_name

Variable that receives Ctrl state

Alt Var

variable_name

Variable that receives Alt state

Expose Prefix

string

keyboard

Compatibility fallback when explicit output variables are empty

Example Use Cases

Basic Movement:

Keyboard(key=W, trigger_mode=While Held) -> AND -> Motion(forward)
Keyboard(key=S, trigger_mode=While Held) -> AND -> Motion(backward)

Jump (On Press):

Keyboard(key=Space, trigger_mode=On Press) -> AND -> Motion(jump)
// Only triggers once per press, must release and press again

Debug Command (Modifier Key):

Keyboard(key=D, require_ctrl=true) -> AND -> Visibility(show debug UI)
// Only triggers when Ctrl+D pressed together

Crouch While NOT Holding Key:

Keyboard(key=Shift, invert=true) -> AND -> Animation(crouch)
// Crouches when Shift is NOT held