CodyBarrett Posted May 7, 2009 Share Posted May 7, 2009 (edited) well... its simple.. and i find it easyer to use this then to drag the mouse back to center.... well.. again i was bored.. but yeah this if the mouse is going to go off the screen... then it movesthe cursor to to opposit end.. eh.. #NoTrayIcon HotKeySet ('!^{ESC}', '_Exit_') MsgBox (48,'Attention!', 'Mouse Wrap will commence.') While 1 $Mgp = MouseGetPos() If $Mgp[0] >= @DesktopWidth - 1 Then MouseMove (2, $Mgp[1], 0) If $Mgp[0] <= 1 Then MouseMove (@DesktopWidth - 2, $Mgp[1], 0) Sleep (100) WEnd Func _Exit_ () MsgBox (48,'Attention!', 'Mouse Wrap has been terminated.') Exit EndFunc CTLR&ALT&ESC closes it.... haha Edited May 10, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted May 7, 2009 Share Posted May 7, 2009 If you are at 5 it jumps the mouse back and forth. Won't let me go to my second monitor . Other than that, I like it. Giggity Link to comment Share on other sites More sharing options...
Mat Posted May 7, 2009 Share Posted May 7, 2009 I used to have a similar program... But it didn't crossover if you went to the edge near the X... How about that then? MDiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 7, 2009 Author Share Posted May 7, 2009 haha.. sorry youknowwho4eva i don't have a double moniter... i wouldn't know waht to change for that to make it work... if you want.. instead of 5 change it to 1.. because its difficult to click on the taskbar... :\ so yeah actually ima change it to that right now [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted May 7, 2009 Share Posted May 7, 2009 (edited) That is a good Idea. Just noticed for you up and down you have the mouse move cords swapped. Edit: A simple quick fix for me is to change all the @desktopwidth's to @desktopwidth*2 Edited May 7, 2009 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 7, 2009 Author Share Posted May 7, 2009 A simple quick fix for me is to change all the @desktopwidth's to @desktopwidth*2 tongue.gifoh lol thats it? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Mat Posted May 7, 2009 Share Posted May 7, 2009 Thats only if both monitors are the same size though... look at jarvis' _ComputerGetMonitors AutoIt Project Listing Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 8, 2009 Author Share Posted May 8, 2009 ah well...i don't own 2 monitors so i can't test it out... if someone would please post how to do that for other people that have 2 monitors.. im sure that would be appreciated.. [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BinaryBrother Posted May 8, 2009 Share Posted May 8, 2009 (edited) The Vertical wrap does not work properly, but it does work... Didn't put enough time in to figure it out, but I did however figure the Horizontal wrap out on Dual-Monitors...#NoTrayIcon HotKeySet ('!^{ESC}', '_Exit_') MsgBox (48,'Attention!', 'Mouse Wrap will commence.') While 1 $Mgp = MouseGetPos() If $Mgp[0] >= @DesktopWidth*2 - 1 Then MouseMove (5, $Mgp[1], '') $Mgp = MouseGetPos() If $Mgp[0] <= 1 Then MouseMove (@DesktopWidth*2-5, $Mgp[1], '') $Mgp = MouseGetPos() If $Mgp[1] >= @DesktopHeight - 1 Then MouseMove (1, $Mgp[0], '') $Mgp = MouseGetPos() If $Mgp[1] <= 1 Then MouseMove (@DesktopHeight - 1, $Mgp[0], '') WEnd Func _Exit_ () MsgBox (48,'Attention!', 'Mouse Wrap has been terminated.') Exit EndFuncOh, and just for the record... @DesktopHeight and @DesktopWidth take on the attributes on the focused monitor I believe... Because at one point my mouse was stuck on my Secondary, using nothing but those macros... I might be wrong, need a comment from a Dev here... Or if I weren't busy ATM, I would do some more testing... Stopped by during a break and seen this... Hope it helped. Edited May 8, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Alek Posted May 8, 2009 Share Posted May 8, 2009 (edited) #NoTrayIcon HotKeySet("{Esc}","_Exit") $Desktop_Area = WinGetPos("Program Manager") If $Desktop_Area[0] < 0 Then $Desktop_Area[2] -= Abs($Desktop_Area[0]) EndIf If $Desktop_Area[1] < 0 Then $Desktop_Area[3] -= Abs($Desktop_Area[1]) EndIf While 1 Sleep(10) $Mgp = MouseGetPos() If $Mgp[0] > $Desktop_Area[2] - 2 Then MouseMove ($Desktop_Area[0] + 2, $Mgp[1], '') ElseIf $Mgp[0] < $Desktop_Area[0] + 2 Then MouseMove ($Desktop_Area[2] - 2, $Mgp[1], '') EndIf If $Mgp[1] > $Desktop_Area[3] - 2 Then MouseMove ($Mgp[0], $Desktop_Area[1] + 2, '') ElseIf $Mgp[1] < $Desktop_Area[1] + 2 Then MouseMove ($Mgp[0], $Desktop_Area[3] - 2, '') EndIf WEnd Func _Exit() Exit EndFunc should work with multiple monitors. Edited May 8, 2009 by Alek [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
UEZ Posted May 8, 2009 Share Posted May 8, 2009 #NoTrayIcon HotKeySet("{Esc}","_Exit") $Desktop_Area = WinGetPos("Program Manager") If $Desktop_Area[0] < 0 Then $Desktop_Area[2] -= Abs($Desktop_Area[0]) EndIf If $Desktop_Area[1] < 0 Then $Desktop_Area[3] -= Abs($Desktop_Area[1]) EndIf While 1 Sleep(10) $Mgp = MouseGetPos() If $Mgp[0] > $Desktop_Area[2] - 2 Then MouseMove ($Desktop_Area[0] + 2, $Mgp[1], '') ElseIf $Mgp[0] < $Desktop_Area[0] + 2 Then MouseMove ($Desktop_Area[2] - 2, $Mgp[1], '') EndIf If $Mgp[1] > $Desktop_Area[3] - 2 Then MouseMove ($Mgp[0], $Desktop_Area[1] + 2, '') ElseIf $Mgp[1] < $Desktop_Area[1] + 2 Then MouseMove ($Mgp[0], $Desktop_Area[3] - 2, '') EndIf WEnd Func _Exit() Exit EndFunc should work with multiple monitors. Yes, it seems to working properly! UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
JRowe Posted May 8, 2009 Share Posted May 8, 2009 Very cool! Made me realize how much I depend on the borders of my screen, as I'm constantly using the taskbar and various widgets that pop out of the sides. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
UEZ Posted May 8, 2009 Share Posted May 8, 2009 (edited) Yes, it seems to working properly!UEZSorry, it is not working properly!X border of my 2nd monitor is not working properly! Because I have different screen resolutions.1st monitor: 1920x12002nd monitor: 1280x10242nd monitor is above 1st monitor centered.I will have a look on it and maybe I can fix it!UEZ Edited May 8, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
WideBoyDixon Posted May 8, 2009 Share Posted May 8, 2009 (edited) I think I've got my logic right but, as usual, I'm prepared to be wrong. I've used MonitorFromPoint and GetMonitorInfo to determine when and where to wrap especially with multiple monitors. Let me know what you think. expandcollapse popupHotKeySet("{ESC}", "_Quit") Global $hDLL = DllOpen("user32.dll") Global $rDesktop = WinGetPos("Program Manager") Global $gMonitorInfo = DllStructCreate("int;int[4];int[4];int;char[32]") DllStructSetData($gMonitorInfo, 1, DllStructGetSize($gMonitorInfo)) _Main() Exit Func _Main() Local $aMP, $hMonitor, $rMonitor, $sText While 1 Sleep(10) $aMP = MouseGetPos() $hMonitor = _GetMonitorFromPoint($aMP[0], $aMP[1]) If $hMonitor <> 0 Then $rMonitor = _GetMonitorRect($hMonitor) ; Left If ($aMP[0] - $rMonitor[0]) = 0 Then If _GetMonitorFromPoint($aMP[0] - 1, $aMP[1]) = 0 Then If _GetMonitorFromPoint($aMP[0] + $rDesktop[2] - 2, $aMP[1]) = 0 Then MouseMove($aMP[0] + $rMonitor[2] - 2, $aMP[1], 0) Else MouseMove($aMP[0] + $rDesktop[2] - 2, $aMP[1], 0) EndIf EndIf EndIf ; Top If ($aMP[1] - $rMonitor[1]) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] - 1) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] + $rDesktop[3] - 2) = 0 Then MouseMove($aMP[0], $aMP[1] + $rMonitor[3] - 2, 0) Else MouseMove($aMP[0], $aMP[1] + $rDesktop[3] - 2, 0) EndIf EndIf EndIf ; Right If ($aMP[0] - $rMonitor[0]) = $rMonitor[2] - 1 Then If _GetMonitorFromPoint($aMP[0] + 1, $aMP[1]) = 0 Then If _GetMonitorFromPoint($aMP[0] - $rDesktop[2] + 2, $aMP[1]) = 0 Then MouseMove($aMP[0] - $rMonitor[2] + 2, $aMP[1], 0) Else MouseMove($aMP[0] - $rDesktop[2] + 2, $aMP[1], 0) EndIf EndIf EndIf ; Bottom If ($aMP[1] - $rMonitor[1]) = $rMonitor[3] - 1 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] + 1) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] - $rDesktop[3] + 2) = 0 Then MouseMove($aMP[0], $aMP[1] - $rMonitor[3] + 2, 0) Else MouseMove($aMP[0], $aMP[1] - $rDesktop[3] + 2, 0) EndIf EndIf EndIf EndIf WEnd EndFunc ;==>_Main Func _GetMonitorFromPoint($iX, $iY) Local $aRet = DllCall($hDLL, "hwnd", "MonitorFromPoint", "int", $iX, "int", $iY, "int", 0) Return $aRet[0] EndFunc ;==>_GetMonitorFromPoint Func _GetMonitorRect($hMonitor) Local $aRet = DllCall($hDLL, "int", "GetMonitorInfo", "hwnd", $hMonitor, "ptr", DllStructGetPtr($gMonitorInfo)) Local $aRect[4] For $i = 1 To 4 $aRect[$i - 1] = DllStructGetData($gMonitorInfo, 2, $i) Next $aRect[2] -= $aRect[0] $aRect[3] -= $aRect[1] Return $aRect EndFunc ;==>_GetMonitorRect Func _Quit() DllClose($hDLL) Exit EndFunc ;==>_Quit EDIT: Some script tidying and removed wrapping line WBD Edited May 8, 2009 by WideBoyDixon jaberwacky 1 [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
UEZ Posted May 8, 2009 Share Posted May 8, 2009 I think I've got my logic right but, as usual, I'm prepared to be wrong. I've used MonitorFromPoint and GetMonitorInfo to determine when and where to wrap especially with multiple monitors. Let me know what you think. expandcollapse popupHotKeySet("{ESC}", "_Quit") Global $hDLL = DllOpen("user32.dll") Global $rDesktop = WinGetPos("Program Manager") Global $gMonitorInfo = DllStructCreate("int;int[4];int[4];int;char[32]") DllStructSetData($gMonitorInfo, 1, DllStructGetSize($gMonitorInfo)) _Main() Exit Func _Main() Local $aMP, $hMonitor, $rMonitor, $sText While 1 Sleep(10) $aMP = MouseGetPos() $hMonitor = _GetMonitorFromPoint($aMP[0], $aMP[1]) If $hMonitor <> 0 Then $rMonitor = _GetMonitorRect($hMonitor) ; Left If ($aMP[0] - $rMonitor[0]) = 0 Then If _GetMonitorFromPoint($aMP[0] - 1, $aMP[1]) = 0 Then If _GetMonitorFromPoint($aMP[0] + $rDesktop[2] - 2, $aMP[1]) = 0 Then MouseMove($aMP[0] + $rMonitor[2] - 2, $aMP[1], 0) Else MouseMove($aMP[0] + $rDesktop[2] - 2, $aMP[1], 0) EndIf EndIf EndIf ; Top If ($aMP[1] - $rMonitor[1]) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] - 1) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] + $rDesktop[3] - 2) = 0 Then MouseMove($aMP[0], $aMP[1] + $rMonitor[3] - 2, 0) Else MouseMove($aMP[0], $aMP[1] + $rDesktop[3] - 2, 0) EndIf EndIf EndIf ; Right If ($aMP[0] - $rMonitor[0]) = $rMonitor[2] - 1 Then If _GetMonitorFromPoint($aMP[0] + 1, $aMP[1]) = 0 Then If _GetMonitorFromPoint($aMP[0] - $rDesktop[2] + 2, $aMP[1]) = 0 Then MouseMove($aMP[0] - $rMonitor[2] + 2, $aMP[1], 0) Else MouseMove($aMP[0] - $rDesktop[2] + 2, $aMP[1], 0) EndIf EndIf EndIf ; Bottom If ($aMP[1] - $rMonitor[1]) = $rMonitor[3] - 1 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] + 1) = 0 Then If _GetMonitorFromPoint($aMP[0], $aMP[1] - $rDesktop[3] + 2) = 0 Then MouseMove($aMP[0], $aMP[1] - $rMonitor[3] + 2, 0) Else MouseMove($aMP[0], $aMP[1] - $rDesktop[3] + 2, 0) EndIf EndIf EndIf EndIf WEnd EndFunc ;==>_Main Func _GetMonitorFromPoint($iX, $iY) Local $aRet = DllCall($hDLL, "hwnd", "MonitorFromPoint", "int", $iX, "int", $iY, "int", 0) Return $aRet[0] EndFunc ;==>_GetMonitorFromPoint Func _GetMonitorRect($hMonitor) Local $aRet = DllCall($hDLL, "int", "GetMonitorInfo", "hwnd", $hMonitor, "ptr", DllStructGetPtr($gMonitorInfo)) Local $aRect[4] For $i = 1 To 4 $aRect[$i - 1] = DllStructGetData($gMonitorInfo, 2, $i) Next $aRect[2] -= $aRect[0] $aRect[3] -= $aRect[1] Return $aRect EndFunc ;==>_GetMonitorRect Func _Quit() DllClose($hDLL) Exit EndFunc ;==>_Quit EDIT: Some script tidying and removed wrapping line WBD Seems to be working properly! Well done WBD Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
youknowwho4eva Posted May 8, 2009 Share Posted May 8, 2009 Mine are of the same resolution so *2 works for me. Here is what I use and looks great. #NoTrayIcon HotKeySet ('!^{ESC}', '_Exit_') MsgBox (48,'Attention!', 'Mouse Wrap will commence.') While 1 $Mgp = MouseGetPos() If $Mgp[0] >= @DesktopWidth*2 - 1 Then MouseMove (1, $Mgp[1], '') $Mgp = MouseGetPos() If $Mgp[0] <= 0 Then MouseMove (@DesktopWidth*2 - 2, $Mgp[1], '') $Mgp = MouseGetPos() If $Mgp[1] >= @DesktopHeight - 1 Then MouseMove ($Mgp[0],1, '') $Mgp = MouseGetPos() If $Mgp[1] <= 0 Then MouseMove ($Mgp[0],@DesktopHeight - 2, '') WEnd Func _Exit_ () MsgBox (48,'Attention!', 'Mouse Wrap has been terminated.') Exit EndFunc Giggity Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 8, 2009 Author Share Posted May 8, 2009 The Vertical wrap does not work properly, but it does work.i found this out... sometimes it sends the cursor to the @desktopwidth ....not sure WHY it does this instead of what its supposed to do [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted May 8, 2009 Share Posted May 8, 2009 (edited) Like I said, I think in post 4, you have your x and y switched on your vertical move. Edit: I've been running my short version all day. I'm loving it. It's actually making me think of another project, when I have a lul in work again. Edited May 8, 2009 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 8, 2009 Author Share Posted May 8, 2009 nahh... it does it no matter what the values are set at.. if its 5 it still does it.. and 1 it does it :\ [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
stinson6016 Posted May 9, 2009 Share Posted May 9, 2009 wow, to much fun! makes me think of the astroid game where the ship would wrap the screen (yes I'm getting old) i takes some getting used to Gnatwork Networks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now