![]() And you can have static variables inside your function that will preserve their value between calls. You can define a function immediately after a hotkey label and that hotkey will fire that function when you press it. These features are (1) hotkey functions and (2) static variables. AutoHotKey has two features that let you implement this cleanly and encapsulate it under your hotkey definition so that you don't depend on any other code. If you need this, you don't need to set up global variables at the top of your script, which is messy (you need to look at two different parts of the script to see what's going on) and error prone (if you use the same variable name for a different thing elsewhere, for example). Press F1 a third time to start firing agan, press F1 once more to stop, and so on. ![]() For example, press F1 to fire continuously until you press F1 a second time. Very often people need to "toggle" some value so that when a key is pressed, a behaviour is set up, and then when the same key is pressed again, the behaviour stops. ![]()
0 Comments
Leave a Reply. |