I'm trying to set up a macro where I can press F5 to activate/deactivate a toggle which would hold down PgUp for the duration of the toggle, while pressing Enter a few times per second.
I've looked online and experimented with a few different Loops, Timers, and Toggles I saw, but none of them have delivered the desired result to far. Most of my attempts have resulted in either a macro that does not start, or repeats until I close AHK. Here's the version I currently have up, though I've tried with multiple others at this point and am ideally looking for a Toggle rather than a loop on a timer. My understanding of this is when I press F5 it would start a 15 second timer where PgUp would be held down for the duration, while Enter is pressed 5 times per second. Can someone please walk me through what I'm doing wrong here and how to set up the Toggle correctly?
Code: Select all
F5::
Settimer, Loopme
Loopme:
Loop, 15000
{
Send, {Enter down}
Sleep 20
Send, {Enter up}
Sleep, 200
Send, {PgUp down}
}