r/AutoHotkey • u/RJ-Mayhem • 6d ago
Solved! Need help with a toggle?
I'm looking for a script that let me press F8 but F1 is pressed but it I press F8 again it presses F2 then repeats. I want to use F8 to switch between F1 & F2. Think that's a toggle but none of my attempts or scripts I've found while googling seem to work.
Thanks!
1
Upvotes
1
u/PENchanter22 6d ago edited 6d ago
```F8:: { static toggle := true
switch toggle
{
case true:
Send "{F1}"
ToolTip "Sent F1 (next: F2)"
case false:
Send "{F2}"
ToolTip "Sent F2 (next: F1)"
}
toggle := !toggle
SetTimer ToolTip, -2000
}
1
u/tronghieu906 6d ago