beyond-all-reason / beyond-all-reason/RecoilEngine
`/unbindall`: safety enter bind isnt quite useful
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
`/unbindall` does not quite unbind all. Afterwards it binds chat to enter, so you can bootstrap and type some fresh `/bind`s manually:
https://github.com/beyond-all-reason/RecoilEngine/blob/3d08c67adfdee5e4b21d6b57adff0a1e6155fd88/rts/Game/UI/KeyBindings.cpp#L939-L946
In practice this isn't enough to let you start rebinding though:
* pressing enter only works to open chat, but doesn't work to finalize it and apply a `/command` (or say the line).
* escape doesn't work to cancel either, so you're stuck with the chat open.
* letter keys are still consumed and work, despite ostensibly not being bound. (This is fine.)
* backspace doesn't work (which is somewhat surprising given letters work, since apparently it's not just about accepting textbox input).
Making it work (i.e. making sure it is possible to manually type in `/bind` after an `/unbind` and work from there) is obviously useful for debugging, but the caveat is that it's something of a breaking change, because now games that want to handle bindings themselves and do `/unbindall` + `/unbind enter chat` to get rid of defaults will find themselves with a bunch of crap still bound and be none the wiser.
I think the solution is to add a `Spring.UnbindAll()` Lua function that actually just unbinds all with no exceptions, and then add more bootstrap bindings to `/unbindall`.
Contributor guide
Research direction
Start in rts/Game/UI/KeyBindings.cpp around lines 939-946, then trace how /unbindall handles chat input and the Enter, Escape, and Backspace keys. Check the proposed Spring.UnbindAll() Lua entry point and the bootstrap bindings. Done means a user can manually enter and apply /bind commands after /unbindall without leaving chat stuck, while the compatibility caveat is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100