Sign in to follow this  
Followers 0
erifash

_MouseWrap Function

5 posts in this topic

Thanks to ezzetabi's _MouseTrap function topic for the idea!

Just some cool piece of code I put together in less than five minutes...

Func _MouseWrap()
  While 1
    $pos = MouseGetPos()
    If $pos[0] < 2 Then MouseMove(@DeskTopWidth - 2, $pos[1], 1)
    If $pos[0] > @DeskTopWidth - 2 Then MouseMove(2, $pos[1], 1)
    If $pos[1] < 2 Then MouseMove($pos[0], @DesktopHeight - 2, 1)
    If $pos[1] > @DeskTopHeight - 2 Then MouseMove($pos[0], 2, 1)
  Wend
EndFunc

Any comments/questions would be greatly appreciated!

Share this post


Link to post
Share on other sites



I usually use Sleep(10) but it really dosen't matter. I remember a BIG debate about that awile ago.

Func _MouseWrap()
  While 1
    $pos = MouseGetPos()
    If $pos[0] < 2 Then MouseMove(@DeskTopWidth - 2, $pos[1], 1)
    If $pos[0] > @DeskTopWidth - 2 Then MouseMove(2, $pos[1], 1)
    If $pos[1] < 2 Then MouseMove($pos[0], @DesktopHeight - 2, 1)
    If $pos[1] > @DeskTopHeight - 2 Then MouseMove($pos[0], 2, 1)
    Sleep(1)
  Wend
EndFunc

Share this post


Link to post
Share on other sites

Nice nice... But I have to remember everyone that Run! have this option integrated. :)

Share this post


Link to post
Share on other sites

That quickly removed my multiple monitor advantage...but still pretty damn fun.

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