Function key triigered by fn+1 etc (touch bar stopped working)

My touchbar stopped working and I was not able to resuscitate it.

How can I create a macro whereby pressing on say fn key and numeral key (1, 2, 3) it would translate into F1, F2, F3 etc pressed.

I assume there is an easy solution with either KM or BTT, but I can not figure it out.

The Fn key isn't "capturable" -- you can't use it in a trigger, can't use it in a "key is down" text, and so on*.

But you can use other modifiers with your number -- say, ⌃⌘1 for F1 -- and have the macro simulate the keystroke. You won't able set the action's keystroke by typing in the usual way, of course, but there's a drop-down to the right of the box that will let you set a function key.

* OK, you might be able to test if it is down with some ObjC or Swift scripting, but it doesn't register as a modifier so you'll be capturing every number key you press and will have to process then "insert by typing" if Fn isn't down, and the odds are that things will be typed out of order as the event queue gets messed about...

1 Like

Fn is not a modifier, what Nige_S advises is certainly the easiest thing you can do.

If you absolutely want to use fn, then change Fn to right control in macos. With KM you can then create macros that only work with right control (fn) + 1. The other control key remains what it was. So, left control + 1 triggers something else.

Perhaps it is even easier to use short/long press. Short press 1 = 1. long press 1 = F1

The situation is different with BTT. fn can be used as a normal modifier. fn + 1 therefore works without any problems.

1 Like

You may want to look at an application named 'Karabiner Elements'. This is a free application that allows you to do this:

Thank you all!