Valuater Posted February 2, 2010 Share Posted February 2, 2010 (edited) I wrote this little helper and really love it. It allows the mouse to pass-through the screen left-to-right and top-to-bottom. Updated to ver 1.0.0.2 MousePass.exe expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Description=MousePass for laptops #AutoIt3Wrapper_Res_Fileversion=1.0.0.2 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_LegalCopyright=By Valuater #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If UBound(ProcessList(@ScriptName)) > 2 Then MsgBox(4096, "Error", "<-MousePass-> is already running. ", 5) Exit 0 EndIf $Height = @DesktopHeight - 1 $Width = @DesktopWidth - 1 ;MsgBox(4096, $Height, $Width) ; for testing $L_Adjust = 1 $R_Adjust = 2 $T_Adjust = 1 $B_Adjust = 2 $Left = 0 + $L_Adjust $Right = $Width - $R_Adjust - 1 $Top = 0 + $T_Adjust $Bottom = $Height - $B_Adjust ; HotKeySet("{ESC}", "Terminate"); this key is hit too often TraySetToolTip("<-MousePass->") If @Compiled = 1 And Not FileExists(@StartupCommonDir & "\MousePass.lnk") Then FileCreateShortcut(@ScriptDir & "\MousePass.exe", @StartupCommonDir & "\MousePass.lnk", @ScriptDir, "", "This is a <-MousePass-> link", "", "", "", @SW_SHOWNORMAL) EndIf While 1 $x = MouseGetPos(0) $y = MouseGetPos(1) If ($x > $Width - 100) And ($y < 50) Then ContinueLoop 1 + 0 * Sleep(50) ; block top right coner If ($x < 50) And ($y > $Height - 50) Then ContinueLoop 1 + 0 * Sleep(50) ; block start button If $x <= 0 Then MouseMove($Right, $y, 0) If $x >= $Width Then MouseMove($Left, $y, 0) If $y <= 0 Then MouseMove($x, $Bottom, 0) If $y >= $Height Then MouseMove($x, $Top, 0) Sleep(50) ;ToolTip("x = " & $x & @CRLF & "y = " & $y, 10, 10) ; for testing WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate ENJOY!!! 8) Edited February 2, 2010 by Valuater Link to comment Share on other sites More sharing options...
Mat Posted February 2, 2010 Share Posted February 2, 2010 Already been done, but this ones quite nice! What I would like to see is a couple of areas where you can't pass the mouse through, mainly the top-right (for the cllose button) and next to the start button. AutoIt Project Listing Link to comment Share on other sites More sharing options...
pintas Posted February 2, 2010 Share Posted February 2, 2010 yeah, i was hoping for that too, but it is working great Link to comment Share on other sites More sharing options...
James Posted February 2, 2010 Share Posted February 2, 2010 Hah, that's brilliant! I've never thought about doing this! I like the idea of boundaries, as suggested by Mat. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Mat Posted February 2, 2010 Share Posted February 2, 2010 heres a simple way to implement it: expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If UBound(ProcessList(@ScriptName)) > 2 Then MsgBox(4096, "Error", "<-MousePass-> is already running. ", 5) Exit EndIf $Height = @DesktopHeight - 1 $Width = @DesktopWidth - 1 ;MsgBox(4096, $Height, $Width) ; for testing $L_Adjust = 1 $R_Adjust = 2 $T_Adjust = 1 $B_Adjust = 2 $Left = 0 + $L_Adjust $Right = $Width - $R_Adjust - 1 $Top = 0 + $T_Adjust $Bottom = $Height - $B_Adjust HotKeySet("{ESC}", "Terminate") TraySetToolTip("<-MousePass->") While 1 $x = MouseGetPos(0) $y = MouseGetPos(1) If ($x > $Width - 100) And ($y < 100) Then ContinueLoop 1 + 0 * Sleep(50) If $x <= 0 Then MouseMove($Right, $y, 0) If $x >= $Width Then MouseMove($Left, $y, 0) If $y <= 0 Then MouseMove($x, $Bottom, 0) If $y >= $Height Then MouseMove($x, $Top, 0) Sleep(50) ;ToolTip("x = " & $x & @CRLF & "y = " & $y, 10, 10) ; for testing WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate AutoIt Project Listing Link to comment Share on other sites More sharing options...
Valuater Posted February 2, 2010 Author Share Posted February 2, 2010 (edited) Included block for exit and for Start button expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If UBound(ProcessList(@ScriptName)) > 2 Then MsgBox(4096, "Error", "<-MousePass-> is already running. ", 5) Exit EndIf $Height = @DesktopHeight - 1 $Width = @DesktopWidth - 1 ;MsgBox(4096, $Height, $Width) ; for testing $L_Adjust = 1 $R_Adjust = 2 $T_Adjust = 1 $B_Adjust = 2 $Left = 0 + $L_Adjust $Right = $Width - $R_Adjust - 1 $Top = 0 + $T_Adjust $Bottom = $Height - $B_Adjust ; HotKeySet("{ESC}", "Terminate"); this key is hit too often TraySetToolTip("<-MousePass->") While 1 $x = MouseGetPos(0) $y = MouseGetPos(1) If ($x > $Width - 100) And ($y < 50) Then ContinueLoop 1 + 0 * Sleep(50) ; block top right coner If ($x < 50) And ($y > $Height - 50) Then ContinueLoop 1 + 0 * Sleep(50) ; block start button If $x <= 0 Then MouseMove($Right, $y, 0) If $x >= $Width Then MouseMove($Left, $y, 0) If $y <= 0 Then MouseMove($x, $Bottom, 0) If $y >= $Height Then MouseMove($x, $Top, 0) Sleep(50) ;ToolTip("x = " & $x & @CRLF & "y = " & $y, 10, 10) ; for testing WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate 8) Edited February 2, 2010 by Valuater Link to comment Share on other sites More sharing options...
pintas Posted February 2, 2010 Share Posted February 2, 2010 WOW! Simply perfect! Thanks guys. I'll be using this one. Link to comment Share on other sites More sharing options...
Minikori Posted February 2, 2010 Share Posted February 2, 2010 Uh oh, can't get to my second monitor, may want to fix that. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
Valuater Posted February 2, 2010 Author Share Posted February 2, 2010 Uh oh, can't get to my second monitor, may want to fix that.Please re-read the topic. This is made for a laptop..... unless you are stacking laptops....lol8) Link to comment Share on other sites More sharing options...
Mat Posted February 2, 2010 Share Posted February 2, 2010 If someone can get me details on how to make this work on more than one screen I'll be happy to try and implement it... This is kinda cool AutoIt Project Listing Link to comment Share on other sites More sharing options...
Minikori Posted February 2, 2010 Share Posted February 2, 2010 Please re-read the topic. This is made for a laptop..... unless you are stacking laptops....lol8)I know it's for a laptop, but you can have multiple monitors on laptops as well. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
logmein Posted February 3, 2010 Share Posted February 3, 2010 A great program! Now, i can do my work with a small desktop area. [font=arial, helvetica, sans-serif][s]Total USB Security 3.0 Beta[/s] | [s]Malware Kill[/s] | Malware Scanner | Screen Hider | Locker | Matrix Generator[s]AUTO-SYNC 1.0 | MD5 Hash Generator | URL Checker | Tube Take [/s]| Random Text[/font] Link to comment Share on other sites More sharing options...
GerrOrneq Posted February 3, 2010 Share Posted February 3, 2010 Thank you very much, interesting utility, I will use it for sure. BTW: For those of you who are a bit hamfisted like me and find it difficult to balance the pointer on the bottom edge to get access to the system tray you may wish to add the following line of code. If ($x > $Width - 100) And ($y > $Height - 50) Then ContinueLoop 1 + 0 * Sleep(50) ; block SystemTray Also, a while back I recall seeing on here a thread where someone supplied a way to determine the location of the Taskbar for those who have the taskbar on the side instead of the bottom, that will need to be taken into account for the non-default taskbar location when blocking the Start or SystemTray. Regards,DeMo. Quote of the week:"BASIC programmers never die, they GOSUB and don't RETURN." -- UnknownWisdom of the ages: I'd be unstoppable... if not for law enforcement and physics. Marriage, the number 1 cause of divorce. Don't steal... the government hates competition. Irish Government Motto: We’ve got what it takes to take what you’ve got. Birthdays are good for you. Statistics show that the people who have the most live the longest. Failure is not an option. It comes bundled with your Microsoft product.-- Ferenc Mantfeld If you learn from your mistakes, then why ain't I a genius?! -- Anonymous Remember, live every day as if it was your last day! one day you will be right. How is it one careless match can start a forest fire, but it takes a whole box to start a campfire? Sure my system is secure, it just locked up again. I haven't lost my mind; I have a tape back-up somewhere. ~Author Unknown Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2010 Moderators Share Posted February 3, 2010 GerrOrneq, How to find the taskbar (and whether it is hidden or not): expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP If $aTaskBar_Pos[1] < 0 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < 0 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFunc M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GerrOrneq Posted February 4, 2010 Share Posted February 4, 2010 @Melba23 Thank you, that is a beautiful, clear and educational example. GerrOrneq, How to find the taskbar (and whether it is hidden or not): expandcollapse popupConsoleWrite(Find_Taskbar() & @CRLF) Func Find_Taskbar() ; Find taskbar Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("classname=Shell_TrayWnd") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0, "") ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] Then Return "Bottom Hidden" Else Return "Bottom" EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT If $aTaskBar_Pos[0] > @DesktopWidth - $aTaskBar_Pos[2] Then Return "Right Hidden" Else Return "Right" EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP If $aTaskBar_Pos[1] < 0 Then Return "Top Hidden" Else Return "Top" EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT If $aTaskBar_Pos[0] < 0 Then Return "Left Hidden" Else Return "Left" EndIf EndIf EndFunc M23 DeMo Quote of the week:"BASIC programmers never die, they GOSUB and don't RETURN." -- UnknownWisdom of the ages: I'd be unstoppable... if not for law enforcement and physics. Marriage, the number 1 cause of divorce. Don't steal... the government hates competition. Irish Government Motto: We’ve got what it takes to take what you’ve got. Birthdays are good for you. Statistics show that the people who have the most live the longest. Failure is not an option. It comes bundled with your Microsoft product.-- Ferenc Mantfeld If you learn from your mistakes, then why ain't I a genius?! -- Anonymous Remember, live every day as if it was your last day! one day you will be right. How is it one careless match can start a forest fire, but it takes a whole box to start a campfire? Sure my system is secure, it just locked up again. I haven't lost my mind; I have a tape back-up somewhere. ~Author Unknown Link to comment Share on other sites More sharing options...
Valuater Posted February 15, 2010 Author Share Posted February 15, 2010 WOW, I was told by someone I have great respect for, that this should be an option in WINDOWS 7 8) Link to comment Share on other sites More sharing options...
wraithdu Posted February 15, 2010 Share Posted February 15, 2010 (edited) I haven't looked at the code, but I assume this should help the multimonitor people: #include <Winapi.au3> ConsoleWrite("Virtual W: " & _WinAPI_GetSystemMetrics(78) & @CRLF) ; SM_CXVIRTUALSCREEN ConsoleWrite("Virtual H: " & _WinAPI_GetSystemMetrics(79) & @CRLF) ; SM_CYVIRTUALSCREEN Edited February 15, 2010 by wraithdu Link to comment Share on other sites More sharing options...
WhiteCrow Posted February 17, 2010 Share Posted February 17, 2010 I'm using this program right now, smart idea Link to comment Share on other sites More sharing options...
kneegrow Posted February 18, 2010 Share Posted February 18, 2010 I like this, I really do =] And I was also hoping, is it possible that you can make this launch on start-up? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 18, 2010 Share Posted February 18, 2010 Put it (or a shortcut to it) in the startup folder. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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