Expand description
Controllers (ticket 0219, game ADR-0034): from each connected pad’s raw state
to the Button presses and releases InputState is fed. Pure:
app fills a PadState per pad every frame (gilrs on native, the
browser’s Gamepad API on web) and Pads::update does the rest, so both
platforms share these rules (docs/design/controls.md, Controller):
- Sticks are 4-way buttons. A stick pushed far enough counts as one held direction button, the direction it is pushed furthest, so it repeats like a held key and never moves diagonally.
- Switch-style pads swap Confirm and Cancel. Bindings name button
positions; on a
PadKind::Nintendopad the bottom and right face buttons trade places before the keymap sees them. - Several pads drive the game as one. A button held on two pads is one press, released when the last pad lets go; unplugging a pad releases what it held.
Structs§
- Button
Set - A set of
Buttons. - PadState
- One pad’s raw state in one frame, as the platform reports it.
- Pads
- Every connected pad, merged into one stream of button presses and releases (see the module docs).
Enums§
- PadKind
- Who made a pad, which decides the Confirm / Cancel swap here and the button names shown on screen (ticket 0220).
Constants§
- DIRECTION_
SETS - A pad’s three sets of direction buttons, each with the name help text gives the whole set.
Type Aliases§
- PadId
- What tells one connected pad from another: the platform’s own number for it, stable while the pad stays plugged in.
- Stick
Buttons - A stick’s direction buttons: up, down, left, right.