systems/input_frame_visualizer¶
Goal¶
Understand the InputFrame data model by watching raw keyboard, mouse, and
gamepad state update in real time on a diagnostic dashboard.
Why this tutorial exists¶
Every SimScene.tick() receives an InputFrame snapshot. Before wiring
action maps or intent systems you need to see what data is available each
frame:
keys_held,keys_pressed,keys_releasedmouse_pos,mouse_buttons_held,mouse_buttons_pressedaxes,buttons(gamepad)
This visualizer renders every field as live text so you can press keys and see the frame-level effect immediately.
Source map¶
Settings profile:
examples/settings/systems/input_frame_visualizer.ymlExample builder:
examples/catalog/systems/input_frame_visualizer/main.pyScene:
examples/catalog/systems/input_frame_visualizer/scenes/scene.pyShared runner:
examples/_shared/runner.py
What to verify¶
On screen you should see four labelled columns:
Keys — held/pressed/released sets update as you type
Mouse — position tracks the cursor; button sets react to clicks
Axes — gamepad analog stick values (if a controller is connected)
Buttons — gamepad digital buttons
Behavior checks:
pressing a key adds it to
keys_pressedfor exactly one frame, then it appears inkeys_helduntil releasedmouse_posreflects virtual-coordinate-mapped positioncolumn labels stay visible even with no input
Run¶
mini-arcade run --example systems/input_frame_visualizer
mini-arcade run --example systems/input_frame_visualizer --pass-through --backend pygame
mini-arcade run --example systems/input_frame_visualizer --pass-through --backend native
Common mistakes¶
Confusing
keys_pressed(edge, one frame) withkeys_held(level).Forgetting that
mouse_posis in virtual coordinates, not window pixels.Expecting gamepad data without a connected controller.