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§
- Action
Map - Named action set, e.g.
"gameplay"vs"menu". With no contexts every action is live; otherwise only actions in an active context fire. - Action
State - Sim-side gameplay input fed from repose events, read per tick.
Edges clear at tick end via
end_tick(registered last). Frame-scope readers callclear_edgesafter 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
- Gamepad
State - Haptic
Bus - Per-device haptic state with tick-accurate effect expiry.
- Haptic
Effect - A constant-strength motor command.
durationof zero runs until stopped. - Keymap
- Per-action remappable bindings: a keyboard/mouse entry plus a
(
Key[$ key][0]keyboard,Key[$ key][1]gamepad). - Keymap
Capture - Pending rebind gesture: which action, which side, armed by the options screen and resolved by the next pressed input.
- Keymap
Row - Serializable row: one action name plus both entries as strings.
Games map
actionback to their enum; the strings stay readable in the save file (KeyW,Space,MouseLeft,PadSouth, …). - Motion
Sample - One reading from a device’s motion sensors, in the device frame.
- Motion
Snapshot - Per-tick readout of a device’s tracked motion.
- Motion
Tracker - Integrates gyro readings into a device orientation, as console SDKs do for
motion controllers:
orientationmaps 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. - Mouse
State - Remap
Session - Staged
Click - Staged pointer click: world position (aim-at-click) plus canvas-dp position (camera-independent menu hit-testing).
- Touch
Contact
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.
- Keymap
Device - next gamepad button when a pad drove the gesture, else the next
keyboard key / mouse button (
Other_10:374-404). - Keymap
Entry - One side of a remappable control: what the keyboard/mouse entry or the gamepad entry currently holds.
- Mouse
Button - PadButton
- Standard-layout buttons (SDL gamecontroller mapping positions). Backends translate hardware codes to these; unknown buttons are dropped.
- Sensor
Kind - Sensor axes a motion-capable controller reports.
Constants§
- GRAVITY
- Gravity magnitude used by
MotionTracker::gravity, in m/s^2.
Traits§
- Action
Like - Action key. Games use their own enums (
Clone + Eq + Hash); a&'static strworks for quick wiring. - Haptic
Sink - Platform hook that receives resolved motor strengths for one device.
- Motion
Source - 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)
KeyChordso 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
ActionStatebuilt frommapinto 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).