sim
Produce synthetic input — for testing a control scheme, scripting a demo, or an agent driving the world from execute(). It injects the same events real devices would, so anything the input system reads, sim can produce.
The input primitives cover keys (tap, hold, separate down/up), mouse buttons (down/up), cursor movement to an absolute position, scroll, and pointer lock. On top of them sit macros: play a timed sequence of input events (inline, from an inputMacro asset, or by identity), record real input over a window into an event list, save an event list as an inputMacro asset, and enumerate the registered macros. This is an authoring and testing surface — game-specific intent like "walk" or "sprint" belongs in caller-authored macros, not here; runtime code reads input through the input system, not through sim.
Macro event shape
A macro event is { t = <seconds since start>, op = <operation>, arg = <op-specific> }. op is one of keyDown, keyUp, mouseDown, mouseUp, mouseMove, scroll, lockPointer, tap, click; events are sorted by t on play. The arg shape follows the op: a key code string for the key ops, a button index for the mouse-button ops, { x, y } (absolute) or { dx, dy } (relative) for mouseMove, a delta for scroll, a boolean for lockPointer, a key code or { key, duration } for tap, and { x?, y?, button?, duration? } for click.
Scoped to this part · feeds back into the world's score.