How to make set of commands while key is pressed down :) Topic is solved

Ask gaming related questions (AHK v1.1 and older)
johnnyboy12m
Posts: 2
Joined: 18 Jun 2018, 03:19

How to make set of commands while key is pressed down :)

18 Jun 2018, 03:52

I'm new to Autohotkey so sorry if this code makes no sense but i would appreciate some help :)
What i would like it to do is whenever o is pressed while LCtrl is held down it performs the commands

LCtrl::
while GetKeyState("LCtrl")
{
SetKeyDelay , 1, 1
o::
ControlSend, , 6, A
ControlSend, , 7, A
ControlSend, , 8, A
}
return
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: How to make set of commands while key is pressed down :)  Topic is solved

18 Jun 2018, 18:59

Code: Select all

LCtrl::
SetKeyDelay , 1, 1 
while GetKeyState("LCtrl", "p")
{
	if GetKeyState("o", "p")
	{
		ControlSend, , 6, A
		ControlSend, , 7, A
		ControlSend, , 8, A
	}
}
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 40 guests