DonationCoder.com Software > Finished Programs
SOLVED: autohotkey makes cursor slide - i want mouse movement to halt the slide
nudone:
i've updated the script slightly. it now calculates the "virtual" desktop covered by all of the monitors. it doesn't detect monitors being enabled/disabled so the script has to rerun if you are changing that kind of thing. it seems to work correctly, but then, i've based it on my inverted T screen layout (2 on top in the middle, 3 in a row along the bottom): 3 in a row works, 2 vertical works, all 4 works, and 1 main monitor works.
i have a request (that i know skwire knows the answer to), for switching the mouse cursor icon to another one - but only whilst the slide cursor function is in operation. i just think it would be nice if a giant cursor appeared whilst the sliding occured. i've had a look on the autohotkey forum but the dllcall function they are talking about for cursor swapping is beyond me.
i might try adding something to the script to detect which monitor the cursor is on. it might be handy for the cursor to travel automatically to the side and then up when trying to slide the cursor from the edge screen(s) to the top screen (and down and across when moving from the top screen to the side screens).
something like:
make cursor slide up
if cursor is on middle screen then slide up
else if cursor is on left screen then slide to right then up
else slide cursor to left and up
that sounds simple enough to my basic understanding of autohotkey.
i may also attempt to make the cursor slow down as it approaches the edges of the screen (as it did using the original MouseMove function).
here's the new script anyway.
--- Code: AutoIt ---SysGet, VirtualScreenLeft, 76 ; get the dimensions of the virtual desktop (all screens)SysGet, VirtualScreenWidth, 78SysGet, VirtualScreenTop, 77SysGet, VirtualScreenHeight, 79CoordMode, Mouse, Screen ; make mouse coordinates relative to screen not active windowHotkey, #k, MoveUpHotkey, ^!+k, MoveUp ; * to work with programmable mouse buttons (if winkey not accepted)Hotkey, ^!+j, MoveDownHotkey, #j, MoveDown ; *Hotkey, #+j, MoveLeftHotkey, ^!+h, MoveLeft ; *Hotkey, #+k, MoveRightHotkey, ^!+l, MoveRight ; * horizontalspeed = 0 ; 0 = fastest, 100 = slowestverticalspeed =0 verticalspeedmultiplier = 50 ; cursor movement needs speeding up a bithorizontalspeedmultiplier = 70borderstop = 100 ; border around screens to halt cursor slidemainscreenwidth = 1920 ; width of monitorTopEdge := VirtualScreenTop + borderstop ; topmost monitor edgeBottomEdge := VirtualScreenHeight + VirtualScreenTop - borderstop ; bottommost monitor edgeLeftEdge := VirtualScreenLeft + borderstop ; leftmost monitorRightEdge := VirtualScreenWidth + VirtualScreenLeft - borderstop ; rightmost monitor edgeFudgeFactor=10 ; margin of error for vertical slidesFudgeFactorHorizontal=2 ; margin of error for horizontal slidesreturn MoveUp:;CoordMode, Mouse, ScreenMouseGetPos, xpos, yposloop{ MouseGetPos, xpos_, If ( xpos_ < ( xpos - FudgeFactor ) OR ( xpos_ > ( xpos + FudgeFactor ) ) ) Break ypos -= verticalspeedmultiplier MouseMove, xpos, ypos, verticalspeed ;if ypos = 0 if ypos < %TopEdge% Break}return MoveDown:;CoordMode, Mouse, ScreenMouseGetPos, xpos, yposloop{ MouseGetPos, xpos_, If ( xpos_ < ( xpos - FudgeFactor ) OR ( xpos_ > ( xpos + FudgeFactor ) ) ) Break ypos += verticalspeedmultiplier MouseMove, xpos, ypos, verticalspeed ;if ypos = %screenheight% if ypos > %BottomEdge% Break}return MoveLeft:MouseGetPos, xpos, yposloop{ MouseGetPos, , ypos_ If ( ypos_ < ( ypos - FudgeFactorHorizontal ) OR ( ypos_ > ( ypos + FudgeFactorHorizontal ) ) ) Break xpos -= horizontalspeedmultiplier MouseMove, xpos, ypos, horizontalspeed ;if xpos = 0 if xpos < %LeftEdge% Break}return MoveRight:MouseGetPos, xpos, yposloop{ MouseGetPos, , ypos_ If ( ypos_ < ( ypos - FudgeFactorHorizontal ) OR ( ypos_ > ( ypos + FudgeFactorHorizontal ) ) ) Break xpos += horizontalspeedmultiplier MouseMove, xpos, ypos, horizontalspeed ;if xpos = %mainscreenwidth% if xpos > %RightEdge% Break}return
Perry Mowbray:
i have a request (that i know skwire knows the answer to), for switching the mouse cursor icon to another one - but only whilst the slide cursor function is in operation. i just think it would be nice if a giant cursor appeared whilst the sliding occured. i've had a look on the autohotkey forum but the dllcall function they are talking about for cursor swapping is beyond me.
-nudone (May 06, 2010, 11:04 AM)
--- End quote ---
You mean this one: http://www.autohotkey.com/forum/topic6107.html which actually leads to this one: http://www.autohotkey.com/forum/topic35600.html
Perry Mowbray:
I think you'd need to be careful that you don't end up chasing your cursor all around your monitors?
-Perry Mowbray (May 06, 2010, 07:34 AM)
--- End quote ---
good point.
-nudone (May 06, 2010, 07:59 AM)
--- End quote ---
In hindsight I think it may be a good idea for a game? :D Maybe you need a gameMode??
nudone:
You mean this one: http://www.autohotkey.com/forum/topic6107.html
-Perry Mowbray (May 06, 2010, 05:39 PM)
--- End quote ---
yes, they are what i saw - and became no less confused after reading them. i will try to understand it, maybe it's very simple.
i have enough fun with this sliding cursor as it is - but you are welcome to modify it into a game, Perry (truth is, it takes me too long to accomplish anything with autohotkey to try "fun" stuff).
Target:
i have enough fun with this sliding cursor as it is - but you are welcome to modify it into a game, Perry (truth is, it takes me too long to accomplish anything with autohotkey to try "fun" stuff).
-nudone (May 06, 2010, 07:35 PM)
--- End quote ---
it's all fun (in a hair tearing, teeth grinding kind of way...)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version