Add ctrl-to-cross-monitors v0.1#3569
Open
manudesir wants to merge 2 commits intoramensoftware:mainfrom
Open
Conversation
m417z
reviewed
Mar 16, 2026
e442ddc to
ef15ad3
Compare
m417z
reviewed
Mar 17, 2026
| // ==WindhawkModSettings== | ||
| /* | ||
| - enabled: true | ||
| $name: Enabled |
Member
There was a problem hiding this comment.
What's the value in having this option compared to disabling the mod?
| ResetCursorState(); | ||
| } | ||
|
|
||
| // Everything below is Windhawk tool boilerplate; the cursor behavior lives above. |
Member
There was a problem hiding this comment.
It'd be more convenient to maintain if you could keep the snippet below identical to the code in the wiki page:
https://github.com/ramensoftware/windhawk/wiki/Mods-as-tools:-Running-mods-in-a-dedicated-process
Thanks.
Comment on lines
+220
to
+221
| while (GetMessageW(&msg, nullptr, 0, 0) > 0) { | ||
| } |
Member
There was a problem hiding this comment.
Use the standard message loop implementation:
Suggested change
| while (GetMessageW(&msg, nullptr, 0, 0) > 0) { | |
| } | |
| while (GetMessageW(&msg, nullptr, 0, 0) > 0) { | |
| TranslateMessage(&msg); | |
| DispatchMessageW(&msg); | |
| } |
|
|
||
| if (crossedMonitor && !IsCtrlHeld()) { | ||
| LogMonitorCrossing(true, g_cursorState.lastPoint, currentPoint); | ||
| ForceCursorTo(g_cursorState.lastPoint); |
Member
There was a problem hiding this comment.
Since you're preventing the move event, is it necessary to also set the cursor pos? If not, you can probably also remove forcedPoint and ignoreForcedPoint.
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:
This mod prevents the mouse cursor from moving to another monitor unless Ctrl is held while moving the mouse.
Tested:
Known limitation
When the Windhawk app window is focused, the cursor restriction does not work. But it works the rest of the time
Author GitHub:
https://github.com/manudesir
License:
MIT