Ability to bind Additional Mouse Buttons + Alt Key#374
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for binding additional mouse buttons (via WM_XBUTTON*) and Left/Right Alt in Red Faction’s controls UI by injecting a “rebind sentinel” scan code and post-processing the binding result into custom scan codes stored in the control config.
Changes:
- Suppress the Windows Alt “menu activation” system command and forward XBUTTON down/up events into the game input pipeline.
- Track pending “extra” inputs (mouse XBUTTONs and Alt) during the rebind flow and swap the sentinel binding to the intended scan code once the UI exits “waiting for key”.
- Extend key name rendering to display friendly names for the custom “Mouse 4+” scan codes; document the feature in the changelog.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| game_patch/os/os.cpp | Swallows SC_KEYMENU and routes WM_XBUTTONDOWN/UP to the mouse input handler. |
| game_patch/misc/ui.cpp | Detects end of rebind capture and replaces the sentinel binding with the pending extra input scan code. |
| game_patch/input/mouse.h | Exposes a Win32 XBUTTON message handler entry point. |
| game_patch/input/mouse.cpp | Implements pending XBUTTON rebind capture + emits custom scan codes for extra mouse buttons. |
| game_patch/input/key.cpp | Captures Alt during rebind (via sentinel) and adds friendly names for extra mouse scan codes. |
| game_patch/input/input.h | Introduces the sentinel and custom scan code constants + pending-rebind accessors. |
| docs/CHANGELOG.md | Adds changelog entries for extra mouse buttons and Alt binding support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…Henkan/M8, require fresh alt press to force crash a hung process
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.
During the work on both #296 and #295: I've discover the way to bypass Red Faction 1's stock bindings by utilizing
CTRL_REBIND_SENTINEL = 0x58for it.This PR will let you bind additional inputs for Mouse Input, while enabling Alt key (both Left and Right Alt keys)

edit: will be adding it to changelog a bit later