Expand description
A Binding’s stable text form, both ways — what a player’s saved rebinds
are written in.
Binding’s Display prints it and its FromStr reads it back, so a
binding round-trips through a settings file whatever holds the file. Like
KeyCode::as_str, which every key here is spelled with, it is a
serialization format, not a display string: a rebind menu shows the
keysym or the pad glyph, never this.
| Binding | Text |
|---|---|
Key | KeyR |
Chord | Alt+KeyR (Shift, Control, Alt, Super) |
ScrollChord | ControlLeft+Scroll |
MouseButton | Mouse:Left, Mouse:Back, Mouse:9 |
ButtonChord | Alt+Mouse:Right (a Chord’s modifier, a MouseButton’s button) |
MouseMotion | MouseMotion |
MouseScroll | MouseScroll |
PointerPosition | Pointer:X, Pointer:Y |
KeyAxis | KeyAxis:KeyS,KeyW (negative, positive) |
Wasd | Wasd:KeyW,KeyS,KeyA,KeyD (up, down, left, right) |
Virtual | Virtual: and the control’s id, verbatim |
PadButton | Pad:South, by PadButton variant |
PadChord | Pad:LeftShoulder+South (modifier, then button) |
PadDpad | Pad:Dpad |
PadStick | PadStick:Left>0.2 (the dead zone) |
PadTrigger | PadTrigger:Right>0.25 (the threshold) |
A dead zone or threshold prints as Rust’s shortest f32 form, which reads
back to the same bits. Parsing checks the spelling only: a threshold
outside 0.0..1.0 parses, and ActionMap::rebind refuses it as it
refuses one built in code. A name this build does not know is a
BindingParseError, never a panic, so a file written by a newer build
costs the one binding and not the load.
Structs§
- Binding
Parse Error - Why a string is not a
Binding’s text form — see the module docs.