This loop needs to send the right mouse button twice in quick succession, then wait a few seconds, then send it twice again, and so on.
I've used this same script with success before to create a loop that toggles on and off like I want, and it works here too, but for some reason it only sends the key once, not twice.
I've tried it this way:
Code: Select all
F4::
RepeatKey2 := !RepeatKey2
If RepeatKey2
SetTimer, SendTheKey2, 300 ; The "100" here is the number of milliseconds between repeats.
Else
SetTimer, SendTheKey2, Off
Return
SendTheKey2:
Send {RButton}
Send {RButton}
Return
I've also tried a slightly different script template, with the same results - it works, but only right clicks once, not twice.
Code: Select all
F4::
{
Toggle:=!Toggle
While, Toggle
{
Send {RButton}
Send {RButton}
Sleep, 2000
}
}
Return