Is it possible to create a Keyboard Shortcut combination using F keys instead of a modifier key, for example F16 D?

thank you very much for your help

This is not a good idea. The main reason is that F keys are not modifier keys and will do things as soon as they are pressed. This is not the case with a real modifier, for example ⌘ which does nothing if pressed on its own.

With that caveat, here is one way you could do this.

The magenta Actions would be replaced by Execute Macro Actions where you would put the Macros you want to trigger.

You would probably want to put it in a Group limited to the App you wanted to use it in. And it wouldn't work if you already had F5 as trigger in a Global Group. And it would hijack F5 from any default use in the App you were using this in.

EXAMPLE Trigger F5.kmmacros (5.1 KB)

Click to Show Image of Macro

1 Like

Zab, that's a good approach, but it only eats the Fn key while the D and E keys are still passed to whatever app is in front. So that may not meet his needs. I guess it depends upon his app, and he hasn't said what it is.

2 Likes

@Zabobon beat me to it, but here's my similar but slightly different approach:

If D-key was pressed while F16-key was down.kmmacros (4.3 KB)

2 Likes

If I am understanding the issue you point towards correctly @Airy, placing this action as the very last action of the macro should deal with that, right?

Pause Until.kmactions (701 B)

Keyboard Maestro Export

EDIT: Or no, my proposition of this action was just silly …

But now I also understand an important difference between mine and @Zabobons approach in that mine would need the F16-key also to be released before the action afte D is pressed can take place again, where as @Zabobons approach would fire in quick succession while D or E is pressed (while F5 is still down)

2 Likes

In both of your approaches the D and E keys are still sent to the user's app. So neither approach is a true solution, because a "true hotkey" would be seen only by the macro and not also sent to the application.

3 Likes

Yes, this is not really something that would be of much use in the real world except in very specific circumstances.

My advice to you @ronald would be to come up with a different hotkey scheme :grinning:

1 Like

I'd echo this advice. However...

If you really want to, this works -- at least for deliberate key press/release. Enable/disable a Group with the F-key:

...and have your single-key triggered macros in that Group:

Demos:

F-Key Group Switch.kmmacros (3.1 KB)
F-Key Test Macros.kmmacros (3.0 KB)

You may get better performance if you split the switcher into two macros, one triggered by press and the other by release.

4 Likes

thank you very much @Zabobon @Nige_S @Alexander @Airy
I will give it a try, but all those warnings give me pause to think twice.

My advice would be the same as on previous occasions that you wanted a keyboard hack, @ronald: use the right tool for the job, which means Karabiner (quite possibly) or, far better still, getting a programmable keyboard (one that uses QMK, ZMK or any other comprehensive system), which can do this sort of thing as a matter of course—and which would also be able to cope with just about any other key trickery you might dream up.

For example, using QMK you could create a layer (a place for defining which keycodes are produced by any physical key on the keyboard) and set that layer to be active while F16 is held (the key would continue to act as normal when tapped). If the layer were called, say, "_MYFUN", the code for this would be: LT(_MYFUN,F16)

In that layer, set the D key to send the keycode for an odd key combination that would never otherwise be used. Finally, set that keycode as your hotkey trigger for KM.

I don't understand the perseverance in trying to find a hacky way for a KM macro to do this sort of thing since each time one is reminded that KM is intended to do its stuff after the key has been received, not to be a keyboard driver.

2 Likes

could you recommend such a keyboard ? thank you

Hah, well that is a bigger question than you may have imagined! :wink:

I'll start by assuming that you want something that is otherwise a conventional keyboard. A quick Web search reminds me of the Keychron brand. Its offerings appear to be reasonably priced and well regarded.

To make sure you're looking at one of the programmable keyboards, Watch out for "QMK/VIA" in the product name or description. VIA is intended to be an easier way of programming keyboards than QMK (which looks daunting at first, but I would expect still gives more flexibility—I'm very used to it and happy with it).

The world of programmable keyboards is dominated by split keyboards. For instance, I use a Lily58, which is a split. I never got the hang of "normal" keyboards but touch typing on a split keyboard feels natural, improves ergonomics and involves no aches and pains! However, they take a lot of getting used to at first, as you would imagine!

To avoid your getting lost in a warren of very deep rabbit holes, I think I would suggest that a Keychron or equivalent conventional keyboard is likely get you off to a good start.

I hope that's a useful pointer. I think, from your posts, that you are someone who would gain enormous benefit from a programmable keyboard!

1 Like

After reading your post, I did some research and there are a gazillion keychron to choose from.
thanks very much for a very original suggestion

1 Like

I should maybe clarify that VIA is a "configurator" for QMK, not something completely different. :slight_smile: See: Why QMK/VIA is one of the most essential features for a custom keyboard?

That's on Keychron's site. Remember, I have never used their keyboards, so I don't know how they may compare to any suitable alternatives you may be able to find. Good luck!

1 Like

thanks again very much !

1 Like

Zabobon has answered but let me chip in. If you are having trouble finding new shortcut key combos Keyboard Maestro has the perfect solution: palettes. Make one that opens from a shortcut and then name the macros you keep on that in a systematic way. In a short time you will find muscle memory takes you to the macro as quickly as a simple shortcut will.

Nearly everything I do on Keyboard Maestro is on that system now. For example to open Messages, I go Option + spacebar. That opens my 'apps' palette. I then type m and then e and that will trigger the macro. It really is lightening fast, honestly, especially when you have some of them in muscle memory. I am not even aware of the palette usually now, it just looks like a flash on the screen.

3 Likes

It's funny you say that because I have dozens of palettes that work that way. As you say, I end up memorizing and it goes very fast. I have this bad habit of always trying to "improve" and it turns out badly 99% of the time. Thank you for your post and for bringing me back to earth.

2 Likes

I do the same. Every time I revert to the palette system!
I think usage can be very idiosycratic especially for some non-techy users like me. Really Keyboard Maestro is more than worth it for me on the basis of just a few macros, probably 10 or less. I have more than that now of course, they do mount up.

1 Like

On a slight side note here now: But I only today realized that option-clicking an entry in the Conflict Palette take you straight to that macro in the editor!

Extremely useful when creating a new macro and accidentally choosing a hotkey already in use — something that happens to me allot! When getting the Conflict Palette, instead of direct macro execution, I often times want to edit the trigger of the previously existing macro, instead of the one where I just added it!

EDIT: Found out now that it also works by option + typing the character highlighted in the palette!

3 Likes

I had no idea you could do that either!