how to run two hotkey simultaneously?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
woshichuanqilz72
Posts: 117
Joined: 05 Oct 2015, 21:23

how to run two hotkey simultaneously?

05 Jul 2018, 23:04

Code: Select all

#MaxThreadsPerHotkey 3
#MaxThreads 2

$a::
{
    loop, 3
    {
        Send, a
        Sleep, 1000
    }
}
Return 

$b::
{
    loop, 3
    {
        Send, b
        Sleep, 1000
    }
}
Return 
I write the code like this , I want the output should be like ababab,

but it seems just one thread, one the output is abbbaa. My question is how to make the two hotkey run simultaneously?
User avatar
divanebaba
Posts: 816
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: how to run two hotkey simultaneously?

06 Jul 2018, 00:01

Hi.
Maybe this thread can help you.
If not, ask again :mrgreen: :mrgreen:
Einfach nur ein toller Typ. :mrgreen:
Rohwedder
Posts: 7768
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: how to run two hotkey simultaneously?

06 Jul 2018, 00:28

Hallo,
or:

Code: Select all

a Up::
SetTimer, Ta, 1000
Ta = 0
Ta:
Send, a
If ++Ta = 3
	SetTimer, Ta, Off
Return
b Up::
SetTimer, Tb, 1000
Tb = 0
Tb:
Send, b
If ++Tb = 3
	SetTimer, Tb, Off
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk and 253 guests