Could these be possible to add as hot keys for our macros in the future? What I mean specifically, is for example, I can simply use a double-tap on the command key to launch a macro. Currently Keyboard Maestro doesn't seem to allow this. I see that I can set "tap twice" "tap 3 times" and so on, but I can't use a command (or opt/shift/control) by itself only in combination with another key.
It must be possible to enable this, because Alfred allows you to simply double tap on one of these keys in their Workflows.
If I recall correctly, this has been discussed before, but as of right now there are no plans for it. I’m happy to be proven wrong though!
That being said, you could always trigger the KM macro via an Alfred workflow, using the “Or by shell script” KM trigger that appears below the main triggers, and pasting the script into the Alfred workflow. I just set up a simple test case that you can see in the following screen shots and it works well.
Keyboard Maestro macro screenshot (click to expand/collapse)
After a short test, I can confirm that @tiffle's method works well, even with an internal keyboard. This could be interesting for users who want to keep their fingers on the keyboard and their eyes on the screen.
Tab or double tab works with all left/right modifiers, including fn.
Modifier combinations are also possible, e.g. left cmd down + tap right cmd. Or any other combination. This works like modifier + letter.
It works well even with palettes. Eg tap left/right cmd (or shift), opens a palette. This doesn't interfere with normal shortcuts (cmd + letter), or capitalization with shift.
If I wasn't already doing all this with BTT, I'd certainly be doing it with KM.
@peternlewis I don't know if you want this or if this is possible, but shortcuts with fn would be available if fn was added here
Ah, yes, I forgot to mention that, because I use BTT for these "modifier shortcuts" (because also fn works) and your macro for the "real" shortcuts. But of course, this also works with your Multi-Press macro
Because Fn is not, in Apple's terms, a modifier key, utilities that value compatibility/stability and so only use Apple's published public APIs won't know when it is pressed.
Some utilities go beyond those APIs, working "behind the scenes", and offer more functionality -- but there's always a risk of sudden breakage when Apple quietly change something.
Yes, Apple do also change the public APIs -- but that's usually either accidental and quickly reverted, or publicised enough in advance that developers can make changes in readiness. Although I'm sure @peternlewis has plenty of war stories from the times that process hasn't worked as advertised...
Say, for example that Keyboard Maestro tried to do this with the Fn key as a modifier.
It can track the state of the Fn key, and know if it is down or up. That's fine.
So you have a hot key trigger active for say Fn-A. But since Fn is not a modifier, that means the hot key trigger would actually be for A, and then when the trigger fired, Keyboard Maestro could check whether the Fn key is down or not. If it is it runs the macro. That's actually probably all doable.
But what if the Fn key is not down. The A key has already been swallowed by the system, and sent to Keyboard Maestro as a hot key. There is no getting out of that without problems. Keyboard Maestro cannot then type an A or add an A to the event queue, because if it did it would end up being out of sequence. For example, you type "A", and "B" in quick succession, so the event queue as "A" and then "B" in it, and then the "A" is processed, swallowed, sent as a hot key, decided that there is no Fn key pressed, added to the event queue, which then has "B" and "A" in it, and assuming the hot key was then disabled for a short (but unknown) amount of time, you would get the out of order sequence "BA".
I understand, and I've found that fast typing can sometimes be an issue with fairly complex macros, but is that really true in practice for something as simple as a single key up/down check? I've tested the same detection idea with keys other than Fn and haven't found it possible to type fast enough for the sequence to be disrupted.
The problem is that, even though Fn isn't accepted as part of a hotkey trigger, holding Fn does affect how KM sees other triggers.
Holding Fn and hitting G will be captured by KM's trigger input field as just G. So we might expect that holding Fn has no bearing on G as a hotkey trigger. However, Fn+G will not trigger the macro but G alone will.
This is unfortunate as it precludes the use of the above detection macro.