need a little help to finish my script off please

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hman
Posts: 32
Joined: 10 Apr 2018, 10:48

need a little help to finish my script off please

31 May 2018, 12:26

my script is that when I press and hold my RMB & LMB the mouse moves down

ok this is what ive worked out

Code: Select all

Insert:: Hotkey, ~RButton & LButton , Toggle

~RButton & LButton::
while GetKeyState("RButton")
{
DllCall("mouse_event", uint, 1, int, 0, int, 5, uint, 0, int, 0)
Sleep, 0
DllCall("mouse_event", uint, 1, int, 0, int, 5, uint, 0, int, 0)
Sleep, 5

}
this works in the way that i have to hold my RMB down then press and hold my LMB in order for it to activate, which is perfect.
now.... problem i have now is, when i let go of my LMB the script carries on, its not untill i let go of my RMB that the script stops

is there a way, maybe with the "pause" code, that when i let go of my LMB it stops, then carries on again when i press my LMB

thx for any help guys & girls, its much apreciated
Hman
Posts: 32
Joined: 10 Apr 2018, 10:48

Re: need a little help to finish my script off please

31 May 2018, 12:39

ok just found out that this doesn't actually clicks the LMB, just makes the mouse move down. I need it to click the LMB too
Hman
Posts: 32
Joined: 10 Apr 2018, 10:48

Re: need a little help to finish my script off please

31 May 2018, 13:09

ok so i messed around with "Click" which on its own is ment to only click the LMB once... but it keeps clicking it.
I've tried "Click, down"
"Click, up"

I've tried "Click"
"Click, up, left"

not getting any joy.
so atm my script looks like the following

Code: Select all

Insert:: Hotkey, ~RButton & LButton , Toggle

~RButton & LButton::
while GetKeyState("RButton")
{
click
DllCall("mouse_event", uint, 1, int, 0, int, 5, uint, 0, int, 0)
Sleep, 0
DllCall("mouse_event", uint, 1, int, 0, int, 5, uint, 0, int, 0)
Sleep, 5

}
any help is greatly apreciated
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: need a little help to finish my script off please

31 May 2018, 14:27

Instead of click maybe try Send {LButton down}? You'll need to manually send LButton Up when the mouse is released, though.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder and 99 guests