Skip to main content

Crate repame_input

Crate repame_input 

Source
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§

ActionMap
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 repose InstallShortcutMap scopes, but for sim-side game actions instead of UI shortcuts.
ActionState
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 call clear_edges after 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).
MouseButton
PadButton
Standard-layout buttons (SDL gamecontroller mapping positions). Backends translate hardware codes to these; unknown buttons are dropped.

Traits§

ActionLike
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_released survive from compose-fed events through the tick’s systems, then clear.
init_state
Insert an ActionState built from map into the sim world.
stick_pair
Readout of one polled axis pair (left stick by default).