Skip to main content

Crate repame_input

Crate repame_input 

Source
Expand description

Physical inputs bound to game actions: leafwing-style map flattened for fixed-tick CPU sims on raw bevy_ecs plus repose input types.

Structs§

ActionMap
Named action set, e.g. "gameplay" vs "menu". With no contexts every action is live; otherwise only actions in an active context fire.
ActionState
Sim-side gameplay input fed from repose events, read per tick. Edges clear at tick end via end_tick (registered last). Frame-scope readers call clear_edges after consuming.
AimTracker
Raw window-physical px from two sources sharing one order clock: the root on_pointer_move (fires almost exclusively while a button is held.
Chord
GamepadState
Keymap
Per-action remappable bindings: a keyboard/mouse entry plus a (Key[$ key][0] keyboard, Key[$ key][1] gamepad).
KeymapCapture
Pending rebind gesture: which action, which side, armed by the options screen and resolved by the next pressed input.
KeymapRow
Serializable row: one action name plus both entries as strings. Games map action back to their enum; the strings stay readable in the save file (KeyW, Space, MouseLeft, PadSouth, …).
MouseState
RemapSession
StagedClick
Staged pointer click: world position (aim-at-click) plus canvas-dp position (camera-independent menu hit-testing).
TouchContact

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: keyboard, pad, or axis. Several bindings can point at the same action.
KeymapDevice
next gamepad button when a pad drove the gesture, else the next keyboard key / mouse button (Other_10:374-404).
KeymapEntry
One side of a remappable control: what the keyboard/mouse entry or the gamepad entry currently holds.
MouseButton
PadButton
Standard-layout buttons (SDL gamecontroller mapping positions). Backends translate hardware codes to these; unknown buttons are dropped.

Traits§

ActionLike
Action key. Games use their own enums (Clone + Eq + Hash); a &'static str works for quick wiring.

Functions§

apply_stick
chord_for_physical
REMAP capture helper: every physical key position maps to a plain (no-modifier) KeyChord so ANY key is capturable.
dead_zone
decode_keymap_entry
encode_keymap_entry
end_tick_system
Edge rollover at tick end: register last so edges survive the tick, then clear.
glyph_for_physical
Physical-position -> glyph table.
init_state
Insert an ActionState built from map into the sim world.
reconcile_held
Reconcile an event-staged held set against polled hardware truth.
stick_pair
Readout of one polled axis pair (left stick by default).