Toggle to repeat a key

Hey all, so i'm new with Keyboard Maestro and I'm trying to use it to copy a function I have using autohotkey on PC. (I am moving to a mac)

So what I want to do is very simple. I want to press a toggle key in this case lets say the '~' key and I want it to send the key press F1 to the screen over and over at a 250ms interval until the '~' key is pressed again to turn it off.

This is pretty simple to do in AHK but I can't seem to get it to work right in KBM and I'm sure i'm just missing something simple.

Thx

Here's a simple solution. Other people may come up with better solutions.

AutoClick Macro (v11.0.3)

AutoClick.kmmacros (4.6 KB)

3 Likes

I found another, cooler, way to do it. This way requires two macros. The first macro looks like this:

And the second macro, which must be in a different group, which I have called "Test v4", looks like this:

EDIT: I forgot to mention you have to choose these settings on the Semaphore action:

1 Like

Thank you for this…I was beating my head against the wall. I will try this out today and see if I can get it working!

1 Like

Personally, I'd go with your first suggestion, to avoid bloating your macro group list. I do like the logic though. :+1:t3:

So i got the first macro to import just fine and it runs great... but you have to manually 'run' it from maestro and then switch to the app is there a way to have it monitor the web browser to be looking for the ~ key press?

i think i figured it out :slight_smile:

Me too, but that's because of the potential for user confusion if their computer crashed and restarted while the second version of the macro was running! "Why is my computer beeping four times a second after login?"

Nice solution, @Airy.

1 Like

Hopefully you've been able to

  1. Put the macro in a Macro Group that is only "Available" in your web browser -- and, even better, only in windows with a particular title
  2. Set the macro's "Hot Key" trigger to ~

Step 1 is important if you ever want to use the ~ key normally elsewhere!

so I've got it all working but there is one issue that i can't replicate.

So in AHK I have it passing F1 but if a certain event happens I can press SHIFT which will pass SHIFT+F1 in AHK that will then perform a new function in the browser.

Well it seems like Maestro 'controls' the keyboard so even if I press SHIFT it still passes F1. Is that 'just how mac works' or is there something in Maestro I can do so that it passes the SHIFT key press to overlay it with the F1.

I think it’s very easy to implement your new requirement. Just replace the “type” action with an if statement that says “if the modifier shift is pressed then send shift F1 but otherwise just press F1.”

I’m away from my computer right now so I can’t program that for you, but it should be pretty easy.

Ok thanks let me try that out

I got it working....thank you for all the help!

2 Likes