Sign in to follow this  
Followers 0
AutoItKing

Mouse Wrap

24 posts in this topic

#1 ·  Posted (edited)

Here's a nice little scrap I found. It's nice. If your mouse goes within 2 pixels of the side, it moves it to the opposite side.

While 1
    $POS = MouseGetPos()
    If $POS[0] > @DesktopWidth - 2 Then MouseMove(1, $POS[1], 0)
    If $POS[0] < 2 Then MouseMove(@DesktopWidth, $POS[1], 0)
    If $POS[1] > @DesktopHeight - 2 Then MouseMove($POS[0], 1, 0)
    If $POS[1] < 2 Then MouseMove(@DesktopHeight, $POS[0], 0)
    Sleep(1)
WEnd
Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites



Good job, but I have no use for it lol

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

i think this in a shortcut does the same :D

Rundll32.exe user,swapmousebutton

Edit: Sorry read it to fast :"> its not the same

but here is another one

Rundll32.exe user,setcursorpos

Edited by Matrix112

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Cool!

i542

EDIT: When I want wrap from up to down, it doesn't work!

Edited by i542

I can do signature me.

Share this post


Link to post
Share on other sites

Here's a nice little scrap I found. It's nice. If your mouse goes within 2 pixels of the side, it moves it to the opposite side.

While 1
    $POS = MouseGetPos()
    If $POS[0] >= @DesktopWidth - 2 Then MouseMove(1, $POS[1], 0)
    If $POS[0] <= 2 Then MouseMove(@DesktopWidth, $POS[1], 0)
    If $POS[1] >= @DesktopHeight - 2 Then MouseMove($POS[0], 1, 0)
    If $POS[1] <= 2 Then MouseMove(@DesktopHeight, $POS[0], 0)
    Sleep(1)
WEnd
I believe the original scrap looked like

HotKeySet("{Esc}","_Exit")

_MouseWrap()

Func _MouseWrap()
    TrayTip("hot key:","press Esc to exit",30)
 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

Func _Exit()
    Exit
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

It works but my Mouse Settings can do this itself :D Nice idea anyway


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Hi,

funny, cool & highly likely useless 4 me. But thanks! :D

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Yeah, I found it in some folder I had, I haven't seen it in a long time, thought I'd share it. :D

Here's something funny, make your mouse go in circles, looks weird!

Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites

I believe the original scrap looked like

HotKeySet("{Esc}","_Exit")

_MouseWrap()

Func _MouseWrap()
    TrayTip("hot key:","press Esc to exit",30)
 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

Func _Exit()
    Exit
EndFunc
Where'd you find that?

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites

Oooo, sorry, didn't know you made it. I didn't know if I made it or someone else did. Sorry!


http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites

Didn't remember who did it, just know that I copied and put it in my scraps almost 2 years ago :D

http://www.autoitscript.com/forum/index.ph...Then+MouseMove(

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That was 2 months after erifash posted it :D

I found 2 of them, and it was 2 years ago, so I thought it might be that one. (and still can't find that post lol).

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

A question I've had that this code brings to mind -

When two monitors are configured, this script only keeps the cursor on screen 1. Is there any way (registry entry, etc) to find out:

1) If there is a second monitor with the desktop extended onto it?

2) If yes to 1, what the desktop size of monitor(s) 2+ is/are?

3) If yes to 1, the "offset" of monitor(s) 2+ to monitor 1, since they could be above/below/diagonal, etc.

Scripts like this MouseWrap or like some screensavers I've made in AutoIt (they only show up on Monitor 1, leaving monitor 2 wide open) would really benefit from this knowledge, and I haven't been able to find it thus far... :D

Thanks :D

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Wrong thread :">

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

This does not make 'real' virtual desktops. For example when desktop two is active it hides the windows on the other desktops. It remembers what windows belong to which desktop by using an ini file.

It was not my understanding that this makes any kind of virtual desktop at all...doesn't this just cause your mouse to jump ("wrap") to the other side like an old atari game?

But, this code would make a nice "switch desktops" method for the Pangaea Desktops program in this thread. :D

I am just interested in finding out if this could be modified to allowing two real monitors sitting side-by-side connected thru a dual-video card.

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Wrong thread lol. Sorry for my idiocy. :">

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

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