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
HapticBus
Per-device haptic state with tick-accurate effect expiry.
HapticEffect
A constant-strength motor command. duration of zero runs until stopped.
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, …).
MotionSample
One reading from a device’s motion sensors, in the device frame.
MotionSnapshot
Per-tick readout of a device’s tracked motion.
MotionTracker
Integrates gyro readings into a device orientation, as console SDKs do for motion controllers: orientation maps the device frame into the world, device-frame angular velocity composes on its right, and the accelerometer is reported in the device frame alongside it.
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.
SensorKind
Sensor axes a motion-capable controller reports.

Constants§

GRAVITY
Gravity magnitude used by MotionTracker::gravity, in m/s^2.

Traits§

ActionLike
Action key. Games use their own enums (Clone + Eq + Hash); a &'static str works for quick wiring.
HapticSink
Platform hook that receives resolved motor strengths for one device.
MotionSource
Platform hook that feeds sensor readings for one device.

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).