how to create a hotkey being pressed for xx ms and do soemthing

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
takayo97
Posts: 63
Joined: 09 Jun 2018, 16:30

how to create a hotkey being pressed for xx ms and do soemthing

21 Nov 2019, 03:04

I want to create a hotkey
left mouse button hold down for xx ms and do a loop for doing something, exit the loop from releasing the button. If press and hold the button again, the loop start and so for
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: how to create a hotkey being pressed for xx ms and do soemthing

21 Nov 2019, 03:33

Hallo,
perhaps:

Code: Select all

~*LButton::
While, GetKeyState("LButton","P")
{
	ToolTip,% A_Index
}
ToolTip
Return
takayo97
Posts: 63
Joined: 09 Jun 2018, 16:30

Re: how to create a hotkey being pressed for xx ms and do soemthing

21 Nov 2019, 05:25

i tried to send char a repeatly while holding down left button, but it didnt work

Code: Select all

~*LButton::
While, GetKeyState("LButton","P")
{

    send a
}
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: how to create a hotkey being pressed for xx ms and do soemthing

21 Nov 2019, 05:39

then:

Code: Select all

*LButton::
While, GetKeyState("LButton","P")
{
	send a
}
Return
but LButtons's native function will be blocked!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Assquatch23, Descolada, Google [Bot] and 345 guests