Proportional cursor between monitors
Keeps the relative (0-1) cursor position when it moves between monitors of different resolutions, so the bottom of a small monitor matches the bottom of a big one
Author: Vitaliy
Windows moves the mouse cursor between monitors using absolute virtual-desktop
pixels. With monitors of different resolutions (for example 2560x1440 next to
1920x1080) this means that leaving the bottom of the small monitor puts the
cursor somewhere in the middle of the big one - the pointer visually "jumps".
This mod makes the transition proportional: the position along the shared
edge is converted to a normalized 0-1 value on the monitor you leave, and
applied to the monitor you enter. The bottom of the small monitor now maps to
the bottom of the big one, the top to the top, the middle to the middle.
leaving 1920x1080 at y = 1000 entering 2560x1440
(1000 / 1079 = 0.93 of the height) (0.93 * 1439 = y 1334)
+--------------------+ 0.00 +--------------------+ 0.00
| | | |
| | | |
| | | |
| | | without the mod |
| | | -> y stays 1000 | 0.69
| | | |
| -> y = 1000 | 0.93 | -> y = 1334 | 0.93
+--------------------+ 1.00 | |
+--------------------+ 1.00
It works for left/right transitions (the Y coordinate is normalized) and for
top/bottom transitions (the X coordinate is normalized).
Bonus: with Cross gaps between monitors enabled you can also leave the
monitor through a part of the edge that has no neighbour at all (for example the
lower 360 px of a 1440p monitor when the 1080p monitor is aligned to the top).
Windows normally blocks the cursor there; the mod teleports it to the
proportional spot on the monitor in that direction.
Notes
- The mod needs neither injection nor function hooks, so it runs as a tool mod
in a dedicated
windhawk.exe process. Its low-level mouse hook therefore
can't stall the shell, and Windhawk guarantees a single instance.
- Cursor movement reported as injected (
LLMHF_INJECTED) is left untouched -
it can't be told apart from the mod's own SetCursorPos. Some setups report
regular movement that way, RDP sessions, VM guest tools and a few tablets and
precision touchpads among them; on those the mod stays inactive.
- While an application confines the cursor with
ClipCursor (most full-screen
games do) the mod stays out of the way.
- When a window of an elevated process is in the foreground, low-level hooks
from a non-elevated process don't receive input. That's a UIPI restriction,
not something the mod can work around.
Contact with me: vicitacal11@ya.ru