Expand description
Physical inputs (keys, mouse buttons, pad buttons, axes) bound to
game actions. (using leafwing InputMap/ActionState as ref., flattened for
fixed-tick CPU sims on raw bevy_ecs + repose input types.)
Structs§
- Action
Map - Named set of actions, e.g.
"gameplay"vs"menu". When a map has no contexts every action is live; otherwise only actions in an active context fire. Mirrors reposeInstallShortcutMapscopes, but for sim-side game actions instead of UI shortcuts. - Action
State - Sim-side gameplay input: fed from repose events each frame, read by
fixed-step systems each tick. Edges (
just_pressed/just_released) clear at the END of each tick (end_tick, registered last), so compose-fed events survive until the tick’s systems run. Frame-scope readers callclear_edgesafter consuming. - Chord
Enums§
- Axis
- Analog axes, normalized to -1.0..=1.0. Triggers report 0.0..=1.0.
- Binding
- One physical source that can drive an action. Many-to-one: several bindings can point at the same action (keyboard + pad + axis).
- Mouse
Button - PadButton
- Standard-layout buttons (SDL gamecontroller mapping positions). Backends translate hardware codes to these; unknown buttons are dropped.
Traits§
- Action
Like - Action key bound. Games use their own enums (must be
Clone + Eq +Hash); a&’static str` works for quick wiring.
Functions§
- end_
tick_ system - Edge rollover at the end of each tick: register LAST in the sim
schedule so
just_pressed/just_releasedsurvive from compose-fed events through the tick’s systems, then clear. - init_
state - Insert an
ActionStatebuilt frommapinto the sim world. - stick_
pair - Readout of one polled axis pair (left stick by default).