Jump to content
Sign in to follow this  

[SOLVED] Mouse within the primary monitor: better script anyone?

Recommended Posts


Hello AutoIt forums,

I have a dual monitor setup and I wrote a simple script that will prevent my cursor to move out from my primary monitor. Here's what I did:

$pos = MouseGetPos()
If $pos[0] >= @DesktopWidth Then
Mousemove(@DesktopWidth - 1, $pos[1],0)
Elseif $pos[0] <= 0 Then
Mousemove(0, $pos[1],0)
Until 0

It's working fine, though I guess there's a better way to do it. (Or is this the best way?) Though please don't tell me just to turn off the dual monitor setup.

Thank you!

Edited by Lilbert

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this