AutoHotKey loop and key pressed

Viewed 648

got a small test script

o::
Suspend

{
Send {JK}        ;
}

Pause,,1
Return

where can i ass a loop so it loops JK and the hotkey o still works?

i tried to put loop in a few places like

Loop,
o::
Suspend

{
Send {JK}        ;
}

Pause,,1
Return

it just didnt work wherever i put the Loop

Or is there another way that could possibly be done doing it not the way I tried? Kinda new to this so hopefully I could get an answer

1 Answers

So if I understand correct, you want the script keep sending JK when you pressed o once and the o still works? If so, this should work. You can add sleep after send if it's too fast. You just need to add ~ before hotkey so it's not blocking the hotkey itself. And for looping JK, Loop should be inside the hotkey function.

~o::
Loop, 
{
Suspend    
Send, {JK}    
Pause,,1
}
Return
Related