Using Function Key as Modifier

I want to use a function key in combination with another key to trigger a macro. For example, when I press F12+Q -> execute the macro. This doesn't seem to be possible (for me?). Is there something that I'm doing wrong, or is there a workaround?

F12 can act like a „modifier“ if you use a palette.

Press and hold F12, press and release "q", release F12. It works as if you press cmd + q.

Of course you can use any letter as a trigger. F12 + q, or a, b, c, d ...


If you don't like the palette, you can also activate/deactivate only the macro group. But the palette has many advantages and is cool. :wink:

I think what @ccstone meant, if you want to have fn + q, then you can only do it with BTT.

1 Like

Thanks for your answer. It works, but I have to press F12 first and afterward press "Q". Ideally I would want to hit F12 and "Q" at the same time. Any other solutions? Thanks tho!

By "first" you mean a millisecond :slightly_smiling_face:

As I said, even if you press cmd + q, cmd must be pressed before q in order to work. :man_shrugging:

I don't think you can press two keys exactly at the same time. The system will always detect one key as being pressed first.

But maybe someone else may know better than I do.

Edit // Ok, what you could do is to set up two typed string triggers. "Key a", "Key b" and then vice versa. This might give you the impression of pressing the keys at the same time. But the fact that two macros are needed proves that it is not so. But I suspect that doesn't work with the F keys.

I'm using a Numpad connected to a remapper. So for example, when I press "Keypad Button 1" it gets remapped to F12 + "Q". So they do type at exactly the same time😕. It would have been a great solution if this wasn't the case tho.

So, you are not wanting to actually physically press F12 + "Q"

Can you not remap to a key combination that Keyboard Maestro can use? Instead of F12 + "Q" could you remap "Keypad Button 1" to say, ⇧⌃⌥⌘Q and use that as the trigger for your Macro?

I have thought about that, but the remapper can't simulate mac's modifier keys. Only those from Windows.

If it's an external keyboard, can't KM recognize a specific key on that device as unique and thus trigger a macro? Something like this

This will work. Thanks!!

Apart from @km814's practical problem, a basic (theoretical) question arises here (at least for me :slightly_smiling_face:)

Assuming one could type "a" and "b" exactly simultaneously, what would macos (KM) do?

Nothing? Or type both? But in which order?

Does anyone know?

You can't. You could, theoretically, press or release those keys simultaneously but the OS would queue that as two separate, ordered, events.

If you ever managed to get it down below the microsecond (or whatever the event resolution is on your machine) the result would be "undefined". It might queue a then b, or b then a, or might even ignore one or both because it can't handle simultaneous keyboard events.

Hi Nige, thanks for answering my pointless questions. :slightly_smiling_face:

In my opinion, the only logical thing to do would be to type nothing at all.

A queue means deciding who got there first. But if both happen at the same time, there is no queue because there is no order. The Os might classify this as "undefined" but do you think it will make its own order? Randomly? Or according to sympathy? Then this would be a kind of artificial intelligence? :wink:

edit // This reminds me of what my math teacher once said.

How many people on our planet are 1.8 meters tall? No one.... if you can measure accurately enough. :joy:

According to this logic, two keys can't be pressed exactly at the same time ... if you can measure accurately enough.

For two truly simultaneous hardware events, the "logical" thing to do is determined by the chip designer -- they may have put in something to deal with it, or they may have decided that the chance of it happening is so vanishingly small that they can ignore it.

But, backing up a little -- it's probably nothing to do with the computer. The point of differentiation will probably be the keyboard since it can't detect two keypress signals at the same time. One will be first, the other will be second, and if the signals arrive at exactly the same moment the word "quantum" will probably be involved :wink:

I don't know enough about the mechanics but I would guess that the second is lost because the first key is down, which is why the gaming k/b manufacturers make such a thing of short debounce times...

This is different to, say, two USB keyboards attached to the same computer -- then it will be whichever keyboard is polled first, after the key presses.

And there's probably a lot more to be considered -- better to ask an Apple hardware engineer rather than some random idiot on the interwebz!

1 Like