Endless mouse

Share your favorite FastKeys commands
marcelolima
Posts: 19
Joined: Apr 11th, ’22, 00:04

Post by marcelolima » Aug 30th, ’22, 22:02

Hi.

I use the script without any problems when I'm using only 1 monitor or 2 monitors aligned horizontally.

But usually, in my office, I use 1 monitor horizontally and another one vertically, as shown in the photo below.

https://drive.google.com/file/d/1h0CPFM ... sp=sharing

Could anyone tell me which adaptation I should make for the script to work normally in this situation?

* width: 2500; height: 1600.

Thank you all.
User avatar
Marko
Posts: 1530
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Sep 10th, ’22, 19:33

How does this work?

Code: Select all

DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
CoordMode, Mouse, Screen
SetTimer, ClosePopup, 200

SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79

ClosePopup:
MouseGetPos, xpos, ypos
if (xpos > VirtualScreenWidth-2)
	MouseMove, 1, ypos, 0
else if (xpos < 1)
	MouseMove, VirtualScreenWidth-2, ypos, 0
else if (ypos > VirtualScreenHeight-2)
	MouseMove, xpos, 1, 0
else if (ypos < 1)
	MouseMove, xpos, VirtualScreenHeight-2, 0
return
Post Reply