Skip to content

In-game keybind editor#8153

Draft
burnhamrobertp wants to merge 4 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/396-keybind-editor
Draft

In-game keybind editor#8153
burnhamrobertp wants to merge 4 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/396-keybind-editor

Conversation

@burnhamrobertp

@burnhamrobertp burnhamrobertp commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Adds an in-game keybind editor as the first tab of the Keys panel, for #396.

You get the commands grouped by category (same grouping as the old Keybinds info tab), each showing its current key(s). Double-click a key to rebind, "+" to add another, "x" to remove. Edits are staged - nothing changes your real keybinds until you hit Save, and Discard throws them away. There's a search box (matches command and category names) and a "Reset to preset" dropdown for Grid/Legacy with a confirm. Saving uses the existing uikeys.txt + KeybindingFile setup, the same way picking Custom in Settings does today.

A couple of the pieces are reusable instance-based widgets (a text input with selection/shortcuts, and a dropdown styled like the Settings selects) that other in-game UI could pick up later - the Settings filter being the obvious one. Save only applies the bind/unbind changes you actually made, so chains, fakemeta, and anything you didn't touch are left alone. Multiple actions on one key are allowed, since the engine supports it and a lot of the defaults rely on it.

Two things I couldn't solve from Lua, both engine-side: while the search box has focus, keys the engine treats as commands (build/unit/camera/volume) still reach the game, because there doesn't seem to be a way to put the engine into its "writing" state from Lua the way native chat does - a small SetUserWriting-style API would fix it for any in-game text field. And capturing a key that's already an engine command fires it once during capture, since its press never reaches Lua.

Only English strings are in so far; other languages fall back to English until they're registered with the translator.

Developed with AI assistance (Claude).

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Integration Test Results

14 tests  ±0   6 ✅ ±0   3s ⏱️ ±0s
 1 suites ±0   8 💤 ±0 
 1 files   ±0   0 ❌ ±0 

Results for commit c85bfa9. ± Comparison against base commit 1addbdd.

♻️ This comment has been updated with latest results.

@burnhamrobertp

Copy link
Copy Markdown
Contributor Author

(was built on top of #8143 and so is left in a draft state until that merges)

@burnhamrobertp burnhamrobertp force-pushed the feature/396-keybind-editor branch from e0a5c38 to c85bfa9 Compare July 1, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant