Code: Select all
q::
Animation_Started := 1
Return
~LShift:: ; Enables a toggle for Push-To-Talk in Mumble between On/Off
if (A_PriorHotkey <> "~LShift" or A_TimeSincePriorHotkey > 350)
{
; Too much time between presses, so this isn't a double-press.
Return
}
; A double-press was detected, script executes the following If/Else code
If toggle := !toggle
{
Send, {Insert Down} ; Enable Push-To-Talk in Mumble
Gosub, Start_Animation ; Begin animations
}
Else
{
Animation_Started := 1 ; Change variable value to "1"
MsgBox, A double-press was detected ; Confirm LShift double-press has triggered
}
Return
Start_Animation:
Loop
{
MsgBox, Hello World
If (Animation_Started = 1) ; Check value of variable. If it is "1"
Break ; End the loop immediately
Sleep, 500
MsgBox, Hello Again!
If (Animation_Started = 1) ; Check value of variable. If it is "1"
Break ; End the loop immediately
Sleep, 500
}
Return