beyond-all-reason / beyond-all-reason/RecoilEngine
bind sc_, binds the space key instead of comma
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
`/bind sc_, ` silently binds the space key instead of comma.
Tested by binding each spelling and then checking which keyset the binding is actually reachable under:
bind , -> reachable by: ,, 0x2c (correct)
bind sc_, -> reachable by: sc_space, sc_0x2c (wrong key)
bind sc_comma -> reachable by: sc_comma, sc_0x36 (correct)
bind sc_0x36 -> reachable by: sc_comma, sc_0x36 (correct)
`sc_comma` and `sc_space` are separate keysets, so this isn't the two names aliasing each other.
The reason looks like the comma escape in ParseKeyChain. Comma is the keychain separator, so when the parse fails it swaps commas for their hexcode and retries, but it always uses the keycode:
keystr.replace(cpos, 1, IntToString(keyCodes.GetCode(","), "%#x"));
That gives 0x2c, which is right for a keycode but is space in scancode space (comma is 0x36). So `sc_,` ends up as `sc_0x2c` and lands on space. Nothing warns either way.
`sc_comma` does work and is the registered name, so there is a way to bind it, it just isn't the obvious one.
Worth saying that none of this is written down. The uikeys reference documents hex notation as the escape hatch for unknown keys, and documents keychains as `, `, but it never mentions that comma is ambiguous as a result, and the keysym table at the bottom is keycodes only. There's no scancode table, which is part of what makes `sc_0x2c` look like the right answer.
Used Claude to help investigate and write this.
Contributor guide
Research direction
Start at ParseKeyChain and trace the comma fallback shown in the issue, then compare its keycode handling with the scancode keysets. Verify that `/bind sc_, ` becomes reachable through the comma scancode rather than the space key, and review the uikeys reference for the documented notation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100