Endless mouse

Share your favorite FastKeys commands
User avatar
marcelolima
Posts: 37
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: 1719
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
User avatar
marcelolima
Posts: 37
Joined: Apr 11th, ’22, 00:04

Post by marcelolima » Oct 17th, ’22, 22:20

Sorry for my delay in responding. But only today I was able to test the script.

The script works fine partially. On the left monitor, which is positioned horizontally, the script is working correctly.
However, on the monitor that is on the right (positioned vertically), the script works correctly just moving the mouse sideways (left and right moves).
It doesn't work correctly when moving up and down: when moving the cursor up, in the middle of the screen the cursor already appears below.

I will make some adaptations and I believe the script will work fine.

Thanks a lot for the help.
Post Reply