macos: move SagePatch window-snap off Ctrl+1..5 to stop shadowing control groups - #23
Open
shakhob22 wants to merge 1 commit into
Open
Conversation
…trol groups SagePatch's SDL_PollEvent interposer consumed Ctrl+1..5 for its window position presets before the game engine ever saw the event, silently breaking Generals' native Ctrl+<number> control-group hotkeys (create/ select unit groups) in windowed mode. Moved window-snap to Alt+1..5 so both features work without conflict. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
SDL_PollEventinterposer (Patches/SagePatch/src/macos/interposers_macos.cpp) consumes every keydown event it recognizes before it reaches the game engine.KeyHandler.cppbound its window-position presets toCtrl+1..5, which is exactly the same chord Generals' native input layer uses for control-group create/select (CREATE_TEAM0..9/SELECT_TEAM0..9inMetaEvent.cpp).Ctrl+1throughCtrl+5never reached the game — control groups were silently unusable for half the numpad row, since SagePatch swallowed the event and returnedtrue(handled).Alt+1..5(SDL_KMOD_ALT) so both features coexist:Alt+1..5for window position,Ctrl+<number>free for the game's own control-group bindings.Why
Found this live while playtesting a fresh macOS build — RMB drag-scrolling worked but edge-scroll and control groups didn't feel right. Edge-scroll turned out to be a local
Options.inisetting (ScreenEdgeScrollEnabledInWindowedApp, not part of this PR); control groups turned out to be this repo's own SagePatch QoL layer stepping on the engine's default keybinds.Test plan
sage_patchCMake target (cmake --build build/macos-vulkan --target sage_patch) and redeployedlibsage_patch.dylib.DYLD_INSERT_LIBRARIES; confirmedAlt+1..5still snaps the window to each preset position.Ctrl+<number>now reaches the game and creates/selects control groups as expected.