Kill Switch Macro

Is there a kill switch macro command for if I hit the wrong macro?

For example, lets say I have two macros on the keyboard. When played, one runs for 1 second and the second runs for 12 seconds. And let’s say I accidentally hit the 12 second one…

Is there a macro I could use to make the 12 second one immediately stop other than unplugging the keyboard?

1 Like

It’s the stopAllMacros command. Put that into a macro and map that macro to a “Stop everything” key.

4 Likes

did not see that, thanks for pointing it out

I feel like I am missing something fundamental. I created a macro that moves my mouse to different locations on the screen. Sometimes I need to kill that macro to get control of the cursor again. My stopAllMacros Macro doesn’t seem to work.

What I did:

  1. Created a blank Macro
  2. added the command “stopAllMacros” to it
  3. assigned that macro to key

Any ideas?

Please post the macro that you are trying to terminate, I will look into it (although, probably not in the next two weeks).

I don’t know if this helps you and your use case: I’ve created a keymap KAL (which is pretty much a copy of my main keymap), and in it’s $onKeymapChange KAL macro I call keepAlive (another macro which will move my mouse around). That other keepAlive macro will loop as long as it’s still on the same KAL keymap. If the keymap changes, it stops looping. So if I want to stop the macro I just switch keymap. It looks a little like this:

// init some stuff
keepalive:
ifNotKeymap KAL goTo final
// do some stuff to move mouse and delay
ifNotKeymap KAL goTo final
// do some more stuff to move mouse and delay
ifKeymap KAL goTo keepalive
final:
// clean up and move mouse to some final position

Thank you for the input maexxx. Although this didn’t help directly with my issue it did teach me a few things and I appreciate the enlightenment.

Here is what I put together using your suggestion:

keepalive:
// had no init stuff as I am not sure what would need to be inited. so I left blank.
ifNotKeymap KAL goTo final
startMouse move up
// did one very basic thing. Knowing that it was going to endlessly move the mouse up.
ifKeymap KAL goTo keepalive
final:
stopMouse move up
// Added this stop so that it would stop moving the mouse once I switched out of this keymap.

A couple of things:

  1. Even though I switched out of the keymap, the mouse never stops moving up. - which is the same thing I was struggling with when I commented on this post without your onKeymapChange suggestion - maybe I am not using the stop command correctly.
  2. I attempted to use the macro I created before to “Stop All Macros” but alas, it did not.