i want do following thing (row 2 out target with the target dimedelays): If i tap c key 1 times --> it should send c instant
If i tap c key 2 times --> it should send c instant and r (delayed due to function call)
If i tap c key 3 times --> it should send c instant and two times r (delayed due to function call)
If i hold down c key --> normal behavior (ccccccccc, instant)
My code up to now is that, which is more or less based on an example of AHK docu https://ahkde.github.io/docs/commands/SetTimer.htm#ExampleCount:
Code: Select all
$c::
send {c}
if (cKeyCount > 0)
{
cKeyCount += 1
return
}
cKeyCount := 1
SetTimer, cKey, -400
return
cKey:
send % cKeyCount = 2 ? "{r}" : "" ; double tap of c-key sends r-key
send % cKeyCount = 3 ? "{r 2}" : "" ; tripple tap of c-key sends 2 x r-key
cKeyCount := 0
return
Thank you