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

Get help with using AutoHotkey and its commands and hotkeys
takayo97
Posts: 62
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: 3516
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: 62
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: 3516
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”

Who is online

Users browsing this forum: boiler, Chunjee, Hologram, mikeyww and 46 guests