multiple hotkeys wont work?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ravena1
Posts: 62
Joined: 06 Sep 2017, 15:13

multiple hotkeys wont work?

21 Aug 2023, 07:30

help please im having issue running multiple hotkey in one script
so i had to make seperate script from it
is there any way to make it work in one script??

Code: Select all

1::
blooming()
return

2::
divider()
return

3::
cyclone()
return




blooming()
{
Send, {w Down}{RButton Down}
sleep, 20
Send, {w up}{RButton up}
sleep, 20
Send, {Shift Down}{LButton Down}{RButton Down}
sleep, 70
Send, {Shift up}{LButton up}{RButton up}
sleep, 150
Send, {LButton Down}
sleep, 30
Send, {LButton up}

return
}


divider()
{
Send, {w Down}{RButton Down}
sleep, 20
Send, {w up}{RButton up}
sleep, 20
Send, {Shift Down}{LButton Down}{RButton Down}
sleep, 70


return
}


cyclone()
{
Send, {w Down}{RButton Down}
sleep, 10
Send, {w up}{RButton up}
sleep, 20
Send, {LButton Down}{RButton Down}
sleep, 200
Send, {LButton up}{RButton up}
sleep, 160
Send, {LButton Down}
sleep, 60
Send, {LButton up}


return
}



end::exitapp
User avatar
mikeyww
Posts: 27191
Joined: 09 Sep 2014, 18:38

Re: multiple hotkeys wont work?

21 Aug 2023, 07:42

It works, but only one subroutine runs at a time. You can combine them into one. You could use variables to indicate which actions should occur in a unified approach. If divider() leaves some buttons down, then remember that they will be down!

A hotkey to be triggered when Shift is down would need a + or * hotkey modifier, or would need to specify the shifted key.

Code: Select all

#Requires AutoHotkey v1.1.33

1::
+1::
Send 2
Return
Or:

Code: Select all

#Requires AutoHotkey v1.1.33

1::
!::
Send 2
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], just me, Rohwedder, zabbn and 109 guests