Configurable controller mappings (settings)#62
Draft
mringsby wants to merge 1 commit into
Draft
Conversation
Controller bindings were hardcoded. Add a logical-action -> physical-input map so they can be edited from the settings UI and persisted. Firmware is unaffected (the map is purely topside input routing). - Controller loads DEFAULT_MAPPING (reproducing the previous hardcoded bindings) and reads stick axes, manipulator triggers, the pitch/roll shift, and the dock/frame buttons through it; get/set/reset_mapping support live reload. - Persisted under 'controller_map' in data/config.json and reapplied on startup. - New endpoints: GET/POST /api/controller/mapping, POST .../reset, and GET /api/controller/live-input (publishes pressed buttons + axis values). - Settings modal gets a Controller Mapping table: per-action SDL/Raw index, an invert toggle for axes, plus press-to-bind capture, Save, and Reset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Controller bindings were hardcoded in
controller.py. This adds a logical-action → physical-input map that can be edited from the settings UI and persisted — firmware is unaffected (purely topside input routing).ControllerloadsDEFAULT_MAPPING(reproducing the previous hardcoded bindings) and reads the stick axes, manipulator triggers, the pitch/roll shift, and the dock/frame buttons through the map.get/set/reset_mappingsupport live reload.controller_mapindata/config.json, reapplied on startup.GET/POST /api/controller/mapping,POST /api/controller/mapping/reset, andGET /api/controller/live-input(publishes pressed buttons + axis values for capture).Based on
feature/dock-hold. Full stack order:feature/light-control→feature/global-frame→feature/dock-hold→feature/controller-mapping. Review/merge in that order.Notes / scope
Verification
ruff check .+ruff format --check .— pass.pytest tests/test_controller.py— pass (override/ignore-unknown, reset-to-defaults, and a test that remapping changes which axis drives surge). Existing input tests still pass since defaults reproduce prior behavior.🤖 Generated with Claude Code