AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Crazy Scripting : Cursor Navigator 1.05 [ by Andreone ]
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
BradMc
Guest





PostPosted: Fri Apr 14, 2006 6:00 pm    Post subject: Dual Monitors Reply with quote

HEy TheLeo.... could you post your mods?? I have a Bual Monitor setup too....


BradMc
Back to top
Jaakon



Joined: 21 Sep 2005
Posts: 2

PostPosted: Tue Apr 18, 2006 1:12 pm    Post subject: Reply with quote

Great script!

But i've found a major bug - version number in the title is still 1.01 Wink

[yes, i can fix it all by myself]
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Wed Apr 19, 2006 7:57 pm    Post subject: Reply with quote

Dear Jaakon, Smile

You wrote:
Great script!


Thanks, Very Happy

You wrote:
But i've found a major bug - version number in the title is still 1.01 Wink [yes, i can fix it all by myself]


Oh! I have corrected it now. Thanks for pointing it.

Regards, Smile
_________________
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Wed Apr 19, 2006 8:01 pm    Post subject: Reply with quote

1.04 : Cursor Navigation is disabled when the "Mouse Left Button" is held down.
_________________
Back to top
View user's profile Send private message
TheLeO



Joined: 11 Jun 2005
Posts: 179
Location: England ish

PostPosted: Thu Mar 22, 2007 9:14 pm    Post subject: Reply with quote

ha ha, funny,,
however, you didn't consider people with 2 monitors (like me)
so when i runn the script i get limited to 1 monitor O.O!!!! Shocked
_________________
And i say: where there is a problem , there is a solution.(well some where that is.)
::
I Have Spoken
::
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dmsuperman
Guest





PostPosted: Sun Jan 13, 2008 8:10 pm    Post subject: Reply with quote

Yeah, can you post your mod? I have a dual monitor, and it would be great to be able to jump over with this but currently I can't. I've got it sorta working, I can still normally move between monitors but moving left jumps to the right side of the left monitor, and I don't have anything going on the right monitor.
Back to top
canta



Joined: 30 May 2006
Posts: 49

PostPosted: Mon Jan 14, 2008 6:56 am    Post subject: Reply with quote

This is great, i have it running all the time.
How about an option to choose only right\left navigating. Or up\down.
I also use dual monitors, and support for that would be nice.

Edit: just found this setting, just had to check the box, stupid me.
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Mon Jan 14, 2008 7:23 am    Post subject: Reply with quote

canta wrote:
How about an option to choose only right\left navigating. Or up\down.


It is already possible.. for example if you do not want horizontal navigation, check all the boxes and move sliders for Left and Right to the extreme right ( When the value is 2001 the wait is infinite )



Re Dual Monitor:
I do not use dual monitor setup though I am equipped.
Ok. Just allow me sometime. I will have to setup it first before I can code.

Thanks Smile


Last edited by SKAN on Mon Jun 16, 2008 12:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Tue Jan 15, 2008 11:06 pm    Post subject: Reply with quote

canta wrote:
I also use dual monitors, and support for that would be nice.
I just start today tinkering with the this nice script to allow an easy integration into an other script. It's not finished yet, I'll post it later.
Anyway, I needed too dual monitor support and it's very easy to add it: replace these lines (172-173)
Code:
  SW = % A_ScreenWidth-1
  SH = % A_ScreenHeight-1
by
Code:
  SysGet, SW, 78
  SysGet, SH, 79
  SW -= 1, SH -= 1
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Wed Jan 16, 2008 4:06 pm    Post subject: Reply with quote

Here's a version that can be easily included.
Note that it can still be runned as stand alone.
Code:
/*  * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    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

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=172685#172685

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.05 by Andreone

                - the script can be included into an other one
                  multi-monitor support
                  mostly based on functions now
                  remove "restore default settings"
                  ini file created only when settings are changed
                  use expressions when possible to reduce code size
                  can use any ini file (default is CursorNavigator.ini) with a [CursorNavigator] section

                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    : 2008-01-16
Version     : 1.05

Scripted in : AutoHotkey Version 1.0.43.02 , www.autohotkey.com

*/
   ; icon for the tray
  IfNotExist, Cn0.ico
    URLDownloadToFile, http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn0.ico, Cn0.ico

  Menu, Tray, NoStandard
  Menu, Tray, UseErrorlevel
  Menu, Tray, Add, &Options, CN_Options
  Menu, Tray, Add
  Menu, Tray, Add, &Pause, CN_Pause
  Menu, Tray, Add, &Reload Script, CN_Reload
  Menu, Tray, Add, &Exit Cursor Navigator, CN_Return
  Menu, Tray, Tip, Cursor Navigator - Running
  Menu, Tray, Default, &Pause
  Menu, Tray, Icon, Cn1.ico,,1

  CursorNavigatorInit()
return

CN_Pause:
  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

CN_Reload:
  Reload
Return

CN_Return:
  ExitApp
Return

CN_Options:
CursorNavigatorShowGui()
Return


CursorNavigatorInit(pIniFile = "CursorNavigator.ini", pWorkingDir = "")
{
  global
  CN_Version = 1.05

  ; ini stuffs
  CN_WorkingDir := (pWorkingDir != "" ? pWorkingDir : A_WorkingDir)
  CN_IniFile := CN_WorkingDir . "\" . pIniFile
  CursorNavigatorReadIni()

  ; get screen dimensions (take into account multi-monitors configurations)
  SysGet, CN_ScreenWidth, 78
  SysGet, CN_ScreenHeight, 79
  CN_ScreenWidth -= 1, CN_ScreenHeight -= 1

  ; icon for the gui
  IfNotExist, Cn1.ico
    URLDownloadToFile, http://file.autohotkey.net/goyyah/CrazyScripts/Mouse/Cn1.ico, %CN_WorkingDir%\Cn1.ico

  ; start monitoring the mouse
  SetTimer, CursorNavigatorCheckMousePos, %CN_Time%
  Return
; ------------------------------------------------------------------------------
CursorNavigatorCheckMousePos:
  If(GetKeyState("Shift" , "P"))
      return

  If(A_OSType = "WIN32_NT" && GetKeyState("LButton" , "P"))
      return

  SetTimer, %A_ThisLabel%, Off
  MouseGetPos, XPos, YPos

  If XPos >= %CN_ScreenWidth%
  {
    If (CN_SleepRightTime=2001 AND CN_SleepRight)
    {
      SetTimer, %A_ThisLabel%, %CN_Time%
      return
    }
    XPos = 2
    If CN_SleepRight
      Sleep, % CN_SleepRightTime
  }
  If YPos >= %CN_ScreenHeight%
  {
    If (CN_WaitBottomTime=2001 AND CN_WaitBottom)
    {
      SetTimer, %A_ThisLabel%, %CN_Time%
      return
    }
    YPos = 2
    If CN_WaitBottom
      Sleep, % CN_WaitBottomTime
  }
  If XPos <= 0
  {
    If (CN_WaitLeftTime=2001 AND CN_WaitLeft)
    {
      SetTimer, %A_ThisLabel%, %CN_Time%
      return
    }
    XPos = %CN_ScreenWidth%
    If CN_WaitLeft
      Sleep, % CN_WaitLeftTime
  }
  If YPos <= 0
  {
    If (CN_WaitTopTime=2001 AND CN_WaitTop)
    {
      SetTimer, %A_ThisLabel%, %CN_Time%
      return
    }
    YPos = %CN_ScreenHeight%
    If CN_WaitTop
      Sleep, % CN_WaitTopTime
  }

  MouseGetPos, nXPos, nYPos
  If (nXpos >= CN_ScreenWidth || nXPos <= 0 || nYPos >= CN_ScreenHeight || nYPos <= 0)
     MouseMove, %XPos%, %YPos%, 0

  SetTimer, %A_ThisLabel%, %CN_Time%
Return ; CursorNavigatorCheckMousePos
} ; CursorNavigatorInit


CursorNavigatorReadIni()
{
  global
  IniRead, CN_Time, %CN_IniFile%, CursorNavigator, Timer, 10
  IniRead, CN_WaitTop, %CN_IniFile%, CursorNavigator, WaitTop, 0
  IniRead, CN_WaitLeft, %CN_IniFile%, CursorNavigator, WaitLeft, 0
  IniRead, CN_WaitRight, %CN_IniFile%, CursorNavigator, WaitRight, 0
  IniRead, CN_WaitBottom, %CN_IniFile%, CursorNavigator, WaitBottom, 0
  IniRead, CN_WaitTopTime, %CN_IniFile%, CursorNavigator, WaitTopDuration, 100
  IniRead, CN_WaitLeftTime, %CN_IniFile%, CursorNavigator, WaitLeftDuration, 100
  IniRead, CN_WaitRightTime, %CN_IniFile%, CursorNavigator, WaitRightDuration, 100
  IniRead, CN_WaitBottomTime, %CN_IniFile%, CursorNavigator, WaitBottomDuration, 100
}


CursorNavigatorWriteIni()
{
  global
  IniWrite, %CN_WaitTop%, %CN_IniFile%, CursorNavigator, WaitTop
  IniWrite, %CN_WaitLeft%, %CN_IniFile%, CursorNavigator, WaitLeft
  IniWrite, %CN_WaitRight%, %CN_IniFile%, CursorNavigator, WaitRight
  IniWrite, %CN_WaitBottom%, %CN_IniFile%, CursorNavigator, WaitBottom
  IniWrite, %CN_WaitTopTime%, %CN_IniFile%, CursorNavigator, WaitTopDuration
  IniWrite, %CN_WaitLeftTime%, %CN_IniFile%, CursorNavigator, WaitLeftDuration
  IniWrite, %CN_WaitRightTime%, %CN_IniFile%, CursorNavigator, WaitRightDuration
  IniWrite, %CN_WaitBottomTime%, %CN_IniFile%, CursorNavigator, WaitBottomDuration
}

CursorNavigatorShowGUI()
{
  global
  local STOPT, SLOPT, SROPT, SBOPT
  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

  STOPT := (CN_WaitTop != "" ? "Checked" : "")
  SLOPT := (CN_WaitLeft != "" ? "Checked" : "")
  SROPT := (CN_WaitRight != "" ? "Checked" : "")
  SBOPT := (CN_WaitBottom != "" ? "Checked" : "")

  Gui,Add,CheckBox, x15 y34  w75 h20 vCN_WaitTop %STOPT%, Top
  Gui,Add,Slider  , x+2 w90 h20 vCN_WaitTopTime gSliderUpdate Range10-2001 AltSubmit, % CN_WaitTopTime
  Gui,Add,Edit    , x+2 w50 h20 Limit4 vWaitTopTime Right Readonly, % CN_WaitTopTime

  Gui,Add,CheckBox, x15 y+15 w75 h20 vCN_WaitLeft %SLOPT%, Left
  Gui,Add,Slider  , x+2 w90 h20 vCN_WaitLeftTime gSliderUpdate Range10-2001 AltSubmit, % CN_WaitLeftTime
  Gui,Add,Edit    , x+2 w50 h20 Limit4 vWaitLeftTime Right Readonly, % CN_WaitLeftTime

  Gui,Add,CheckBox, x15 y+15 w75 h20 vCN_WaitRight %SROPT%, Right
  Gui,Add,Slider  , x+2 w90 h20 vCN_WaitRightTime gSliderUpdate Range10-2001 AltSubmit, % CN_WaitRightTime
  Gui,Add,Edit    , x+2 w50 h20 Limit4 vWaitRightTime Right Readonly, % CN_WaitRightTime

  Gui,Add,CheckBox, x15 y+15 w75 h20 vCN_WaitBottom %SBOPT%, Bottom
  Gui,Add,Slider  , x+2 w90 h20 vCN_WaitBottomTime gSliderUpdate Range10-2001 AltSubmit, % CN_WaitBottomTime
  Gui,Add,Edit    , x+2 w50 h20 Limit4 vWaitBottomTime Right Readonly, % CN_WaitBottomTime

  Gui, Font, S8 Normal, Verdana

  Gui, Add, Picture, x7 y+27 w42 h-1,Cn1.ico
  Gui, Add, Button, x+10  w110 h20 0x8000 gApply, &Apply Changes
  Gui, Add, Button, x+10  w60  h20 0x8000 gCancel, &Cancel

  Gui, Show, h220, Cursor Navigator %CN_Version%
 
  Return
; ------------------------------------------------------------------------------
GuiClose:
GuiEscape:
Cancel:
  Gui,Destroy
Return

Apply:
  Gui,Submit
  CursorNavigatorWriteIni()
  Gui,Destroy
Return

SliderUpdate:
  GuiControl,,WaitTopTime, % CN_WaitTopTime
  GuiControl,,WaitLeftTime, % CN_WaitLeftTime
  GuiControl,,WaitRightTime, % CN_WaitRightTime
  GuiControl,,WaitBottomTime, % CN_WaitBottomTime
Return
} ; CursorNavigatorShowGUI


Changes:
- the script can be included into an other one
- multi-monitor support
-mostly based on functions now
-remove "restore default settings"
-ini file created only when settings are changed
-use expressions when possible to reduce code size
-can use any ini file (default is CursorNavigator.ini) with a [CursorNavigator] section

@SKAN, I hope you don't mind I took so much liberty with your script. I don't want to steel your thunder, but I just wanted to share my work, as I think it can be useful to some people, who like me, don't like to have tons of script running at the same time when only one is enough.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Thu Jan 17, 2008 5:12 am    Post subject: Reply with quote

Andreone wrote:
@SKAN, I hope you don't mind I took so much liberty with your script.


Do not be so formal. Very Happy

I suggest you to alter the script header as you deem fit.

Many thanks for improving the script. I will try to test it in a multi-monitor setup and revert back.

Smile

Edit: The title post now points to the above post.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group