How Do I Use the same hotkey to run/stop a macro?

In this case you do not want to use a semaphore lock.
Use a global variable to indicate if your macro is running.

This macro should give you an idea of how to do this. Of course you will need to adapt to your specific needs, and assign a hot key trigger.

MACRO:   Toggle Start/Stop of Macro [Example]


#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/b/d/bd4a0aaaa73953dfce8d2c8284d54a153703f098.kmmacros">Toggle Start-Stop of Macro [Example].kmmacros</a> (5.8 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---



![image|612x1715](upload://tJzyIewUsXFuSbd7Fksq6yUQBOV.png)
2 Likes