Add rebindable key and controller bindings with settings page - #68
Merged
Conversation
- New bindings layer above Bevy's raw input: 60 actions grouped by function, controllable by key or pad button - Levers (throttle, brake valve, direct brake) mappable to stick axes or triggers for absolute control - Right stick for look, left stick for walk: always-on, unbindable - Settings → Key bindings page: rebind with Enter, clear with Backspace, Esc to cancel - One binding per key (rebinding elsewhere removes old binding) - Stored under [controls] binds, only changes persisted so defaults reach new players - F5 key help updated in real-time when bindings change - Controller answers to same bindings on every connected pad - Multiplayer safe: bindings are local, CabInputs carries the state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/app/src/bindings.rs: a complete rebinding system for ~60 controls grouped into buttons (press/release) and levers (position-based)Enterto rebind (captures next key or controller button),Backspaceto clear,Escto cancel[controls]section; only non-default rows are persisteden/main.ftlandde/main.ftlF5) dynamically rewritten when bindings changeshotscache)Testing
Enter, press a key, confirm it takes effectEnter, move analog stick/pull trigger, confirm axis is boundEnter, pressBackspace, confirm input is removedEnter, pressEsc, confirm original binding unchanged[controls]section only contains changed rowsF5) reflects current bindings after changesCabInputspositions still network correctly