Skip to content

Ability to bind Additional Mouse Buttons + Alt Key#374

Merged
GooberRF merged 8 commits into
GooberRF:masterfrom
AL2009man:AdditionalKB/M
Jul 7, 2026
Merged

Ability to bind Additional Mouse Buttons + Alt Key#374
GooberRF merged 8 commits into
GooberRF:masterfrom
AL2009man:AdditionalKB/M

Conversation

@AL2009man

@AL2009man AL2009man commented May 15, 2026

Copy link
Copy Markdown
Contributor

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 = 0x58 for it.

This PR will let you bind additional inputs for Mouse Input, while enabling Alt key (both Left and Right Alt keys)
image

edit: will be adding it to changelog a bit later

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread game_patch/input/input.h Outdated
Comment thread docs/CHANGELOG.md Outdated
@GooberRF GooberRF merged commit 98d819d into GooberRF:master Jul 7, 2026
2 checks passed
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.

3 participants