Brown Baron
Brown Baron

Reputation: 13

Autohotkey | Change The Speed The Curser Drags Down

So, I have an .ahk script that drags the mouse down if you hold down the left mouse button. I was wondering how to change the value to it goes faster/slower and any help would be greatly appreciated.

Here is the script used

    #NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

; NRA
NRA := 1

; NR
~LButton::
while GetKeyState("LButton") & NRA
{
DllCall("mouse_event", uint, 1, int, 0, int, 1, uint, 0, int, 0)
Sleep, 15
DllCall("mouse_event", uint, 1, int, 0, int, 1, uint, 0, int, 0)
Sleep, 5
}
return

; keys
Insert::ExitApp
delete::suspend

Upvotes: 0

Views: 2252

Answers (1)

Bob
Bob

Reputation: 431

https://msdn.microsoft.com/en-us/library/windows/desktop/ms646260(v=vs.85).aspx

Second and third parameters are position, x and y. Look at it like that:

DllCall("mouse_event", uint, 1, int, x, int, y, uint, 0, int, 0)

In your case, since you want to "drag down", you are interested in changing y.

So for example:

DllCall("mouse_event", uint, 1, int, 0, int, 5, uint, 0, int, 0)

Upvotes: 0

Related Questions