Sign in to follow this  
Followers 0
Mingre

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

2 posts in this topic

#1 ·  Posted (edited)

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:

Do
$pos = MouseGetPos()
If $pos[0] >= @DesktopWidth Then
Mousemove(@DesktopWidth - 1, $pos[1],0)
Elseif $pos[0] <= 0 Then
Mousemove(0, $pos[1],0)
EndIf
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



Thanks 69255!

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  
Followers 0