/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * Disclaimer: I do not foresee any risk in running this script but you may run this file "ONLY" at your own risk. * * * * * * * * * * * * * * * * * * * * * * * * * * * * File Name : CursorNavigator.ahk Version : 1.04 Download : http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/CursorNavigator.ahk Snapshot : http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/CnSnapshot.gif Icons : http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn0.ico http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn1.ico Post : http://www.autohotkey.com/forum/viewtopic.php?p=56253#56253 Main Title : Mouse Utility Sub Title : Cursor Navigator Description : This Script navigates the Mouse Cursor in a special way. For example, If you move the Mouse Cursor off the right boundary of the desktop, it will appear on the left side, eliminating the need to drag it all the way across your desktop. It works the same way on every side of the screen. The navigation of cursor (to Opposite side) can be slowed down by configuring the Wait (in Milliseconds) for each Desktop Boundary through the Option available in "Tray Menu". Range for Wait (in Milliseconds) is 10 to 2000. Setting it 2001 will disable navigation for that side of the desktop. Double-Clicking on the "Tray Icon" toggles the Script`s status between Pause/Run. This Script requires two icons which will be automatically downloaded! Update: 1.04 - Cursor Navigation is disabled when "Left Mouse Button" is held down. Works only with Windows NT, Windows 2000 & Windows XP 1.03 - Cursor Navigation is disabled when the "Shift key" is held down 1.02 - Fixed an erratic movement of Cursor. If a boundary is hit accidentally and though moved away from it, the script was relocating the Cursor (after the "wait period"), which is now fixed. 1.01 - Enabling a Wait (for a Desktop Boundary) and setting it 2001 will disable it. - Icons were not displayed properly, now fixed. Credits : Based on Software : CursorUS @ http://www.snapfiles.com/reviews/CursorUS/cursorus.html Ideas by : Rene aka midiworks. Author : A.N.Suresh Kumar aka "Goyyah" Email : arian.suresh@gmail.com Created : 2006-04-10 Modified : 2006-04-19 Version : 1.04 Scripted in : AutoHotkey Version 1.0.43.02 , www.autohotkey.com */ #Persistent #SingleInstance, Force CoordMode, Mouse, Screen IfNotExist, CnSet.ini GoSub, CnSetIniCreate IfNotExist, Cn0.ico URLDownloadToFile ,http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn0.ico ,Cn0.ico IfNotExist, Cn1.ico URLDownloadToFile ,http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn1.ico ,Cn1.ico Menu, Tray, NoStandard Menu, Tray, UseErrorlevel Menu, Tray, Add, &Options, Options Menu, Tray, Add Menu, Tray, Add, &Pause, Pausee Menu, Tray, Add, &Reload Script, Reloadd Menu, Tray, Add, &Exit Cursor Navigator , Exitt Menu, Tray, Tip, Cursor Navigator - Running Menu, Tray, Default, &Pause Menu, Tray, Icon, Cn1.ico,,1 IniRead, ST, CnSet.ini, Settings, TWait IniRead, SL, CnSet.ini, Settings, LWait IniRead, SR, CnSet.ini, Settings, RWait IniRead, SB, CnSet.ini, Settings, BWait IniRead, WT, CnSet.ini, Settings, TWaitDuration IniRead, WL, CnSet.ini, Settings, LWaitDuration IniRead, WR, CnSet.ini, Settings, RWaitDuration IniRead, WB, CnSet.ini, Settings, BWaitDuration If ST STOPT=Checked If SL SLOPT=Checked If SR SROPT=Checked If SB SBOPT=Checked Gui, +ToolWindow +AlwaysOnTop Gui, Margin, 4,4 Gui, Add, Groupbox, x5 y10 w240 h166, Milliseconds to wait on Desktop Boundaries Gui, Font, S10 Bold, Verdana Gui,Add,CheckBox, x15 y34 w75 h20 vST %STOPT%, Top Gui,Add,Slider , x+2 w90 h20 vWT gSliderUpdate Range10-2001 AltSubmit, % WT Gui,Add,Edit , x+2 w50 h20 Limit4 vVT Right Readonly, % WT Gui,Add,CheckBox, x15 y+15 w75 h20 vSL %SLOPT%, Left Gui,Add,Slider , x+2 w90 h20 vWL gSliderUpdate Range10-2001 AltSubmit, % WL Gui,Add,Edit , x+2 w50 h20 Limit4 vVL Right Readonly, % WL Gui,Add,CheckBox, x15 y+15 w75 h20 vSR %SROPT%, Right Gui,Add,Slider , x+2 w90 h20 vWR gSliderUpdate Range10-2001 AltSubmit, % WR Gui,Add,Edit , x+2 w50 h20 Limit4 vVR Right Readonly, % WR Gui,Add,CheckBox, x15 y+15 w75 h20 vSB %SBOPT%, Bottom Gui,Add,Slider , x+2 w90 h20 vWB gSliderUpdate Range10-2001 AltSubmit, % WB Gui,Add,Edit , x+2 w50 h20 Limit4 vVB Right Readonly, % WB Gui, Font, S8 Normal, Verdana Gui, Add, Picture, x7 y+27 w42 h-1,Cn1.ico Gui, Add, Button, x+10 w180 h20 0x8000 gRestore , &Restore Default Settings Gui, Add, Button, xs+54 y+2 w110 h20 0x8000 gApply , &Apply Changes Gui, Add, Button, x+10 w60 h20 0x8000 gCancel, &Cancel GoSub,CheckMousePos Return CheckMousePos: ShiftIsDown := GetKeyState("Shift" , "P") If ShiftIsDown Exit If A_OSType=WIN32_NT { MouseLeftButtonIsDown := GetKeyState("LButton" , "P") If MouseLeftButtonIsDown Exit } SetTimer, CheckMousePos, Off SW = % A_ScreenWidth-1 SH = % A_ScreenHeight-1 MouseGetPos, XPos, YPos If XPos >= %SW% { If (WR=2001 AND SR) { SetTimer, CheckMousePos, 10 Exit } XPos = 2 If SR Sleep, % WR } If YPos >= %SH% { If (WB=2001 AND SB) { SetTimer, CheckMousePos, 10 Exit } YPos = 2 If SB Sleep, % WB } If XPos <= 0 { If (WL=2001 AND SL) { SetTimer, CheckMousePos, 10 Exit } XPos = %SW% If SL Sleep, % WL } If YPos <= 0 { If (WT=2001 AND ST) { SetTimer, CheckMousePos, 10 Exit } YPos = %SH% If ST Sleep, % WT } MouseGetPos, nXPos, nYPos If (nXpos>=SW OR nXPos<=0 OR nYPos>=SH OR nYPos<=0) MouseMove, % XPos, % YPos, 0 SetTimer, CheckMousePos, 10 Return Pausee: If A_IconTip=Cursor Navigator - Running { Menu, Tray, Tip, Cursor Navigator - Paused Menu, Tray, Check, &Pause Menu, Tray, Icon, Cn0.ico,, 1 Pause } Else { Menu, Tray, Tip, Cursor Navigator - Running Menu, Tray, UnCheck, &Pause Menu, Tray, Icon, Cn1.ico,, 1 Pause } Return Restore: FileDelete,CnSet.ini Reload Return Reloadd: Reload Return Exitt: ExitApp Return Options: Gui,Show,h240 ,Cursor Navigator v1.04 Return GuiClose: GuiEscape: Cancel: Reload Return Apply: Gui,Submit IniWrite, % ST, CnSet.ini, Settings, TWait IniWrite, % SL, CnSet.ini, Settings, LWait IniWrite, % SR, CnSet.ini, Settings, RWait IniWrite, % SB, CnSet.ini, Settings, BWait IniWrite, % WT, CnSet.ini, Settings, TWaitDuration IniWrite, % WL, CnSet.ini, Settings, LWaitDuration IniWrite, % WR, CnSet.ini, Settings, RWaitDuration IniWrite, % WB, CnSet.ini, Settings, BWaitDuration Reload Return SliderUpdate: GuiControl,,VT, % WT GuiControl,,VL, % WL GuiControl,,VR, % WR GuiControl,,VB, % WB Return CnSetIniCreate: IniWrite, 0 , CnSet.ini, Settings, TWait IniWrite, 0 , CnSet.ini, Settings, LWait IniWrite, 0 , CnSet.ini, Settings, RWait IniWrite, 0 , CnSet.ini, Settings, BWait IniWrite, 10 , CnSet.ini, Settings, TWaitDuration IniWrite, 10 , CnSet.ini, Settings, LWaitDuration IniWrite, 10 , CnSet.ini, Settings, RWaitDuration IniWrite, 10 , CnSet.ini, Settings, BWaitDuration Return