ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: autohotkey makes cursor slide - i want mouse movement to halt the slide

(1/4) > >>

nudone:
i've been using this simple script to slide my cursor around my screen(s) by hitting buttons on my house (these buttons are just assigned to keyboard hotkeys that i'll never normally use).

i find the sliding method of moving the cursor very nice - it means i hardly have to move the mouse about on the mat and, i'm not sure why, but it just seems to feel nicer than using an accelerated cursor (i haven't got used to using skwire's MAT app).

REQUEST:
so, here's the request. although i like this sliding cursor motion - it has to carry out the full autohotkey "MouseMove" function before releasing the cursor - so i can't break the movement part way by moving the cursor with my mouse.

does that make sense? in other words: i'd like the buttons on my mouse to start the cursor sliding across the screen BUT as soon as i move the mouse myself - autohotkey releases the cursor and lets me take control.

i thought i'd be able to figure this out myself but i soon realised that the "MouseMove" function isn't something i can command to stop. well, not with my basic knowledge.

i've included my script if it helps - thanks.


--- Code: AutoIt ---;SlideCursor;By nudone;date: 2010-04-26ScriptVersion=0.2;function: Slides mouse cursor across whole screens. For multi-monitor systems. ;CoordMode,Mouse,Screen ;this isn't used;# = winkey, ! = alt, ^ = control, + = shift Menu,Tray,Icon,%SystemRoot%\system32\SHELL32.dll,101Menu,Tray,Tip,SlideCursor %ScriptVersion% Hotkey, #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       ; * ;screen sizesTopScreenHeight=1080MiddleScreenWidth=1920LeftScreenWidth=1024RightScreenWidth=1024 ;mouse cursor movement speedVerticalSpeed=5 ; 0 = fastet, 100 = slowestHorizontalSpeed=10return ; Move the mouse upwards:MoveUp:MouseGetPos, xpos, ypos MouseMove, xpos, ypos - (TopScreenHeight*0.95), VerticalSpeedreturn ; Move the mouse downwards:MoveDown:MouseGetPos, xpos, yposMouseMove, xpos, ypos + (TopScreenHeight*0.95), VerticalSpeedreturn ; Move the mouse to (far) left:MoveLeft:MouseGetPos, xpos, ypos ;MouseMove, xpos - MiddleScreenWidth - LeftScreenWidth , ypos, HorizontalSpeed ; use for 3 screens full travelMouseMove, xpos - LeftScreenWidth, ypos, HorizontalSpeed ;return ; Move the mouse to (far) right:MoveRight:MouseGetPos, xpos, ypos ;MouseMove, xpos + MiddleScreenWidth + LeftScreenWidth , ypos, HorizontalSpeed ;use for 3 screens full travelMouseMove, xpos + RightScreenWidth, ypos, HorizontalSpeedreturn

cranioscopical:
i've been using this simple script to slide my cursor around my screen(s) by hitting buttons on my house-nudone (May 05, 2010, 05:10 PM)
--- End quote ---
Clearly you need to modify the home keys.

Target:
i've been using this simple script to slide my cursor around my screen(s) by hitting buttons on my house...
--- End quote ---

for some reason this rang a bell with me too...

My initial thoughts on this would be to move the cursor incrementally within a loop (so there is something to break out of)

eg

--- ---mousegetpos, xpos, ypos

loop
{
    mousegetpos, , ypos_
    if ypos_ <> ypos
        break
    xpos++ 
    mousemove, xpos, ypos, horizontalspeed

    if xpos = %rightscreenwidth%
        Break
}
 
this is an example only - I haven't tested it, but it should break out of the loop when it reaches the screen width, or if the mouse position varies vertically (this being a horizontal movement)

AndyM:
i've been using this simple script to slide my cursor around my screen(s) by hitting buttons on my house-nudone (May 05, 2010, 05:10 PM)
--- End quote ---
Clearly you need to modify the home keys.
-cranioscopical (May 05, 2010, 06:03 PM)
--- End quote ---
;D

nudone:
i've been using this simple script to slide my cursor around my screen(s) by hitting buttons on my house-nudone (May 05, 2010, 05:10 PM)
--- End quote ---
Clearly you need to modify the home keys.
-cranioscopical (May 05, 2010, 06:03 PM)
--- End quote ---
heheheh, oh dear. but very good cranioscopical.

thanks, Target, i will try your script out when i get chance later. it looks like it will work. i'll let you know. (nice bell pun by the way).

Navigation

[0] Message Index

[#] Next page

Go to full version