Prior to version 7.0, Keyboard Maestro did not support the tapped twice modifier for Hot Key and USB Device Key triggers, but there are two ways you can accomplish this if desired. Either way, you use a USB Device Key trigger to trigger on the press of the control key.
The first way is to keep track of the time the macro last fired, and only perform the macro if it was fired recently.
The second way is to have two (or more) macros, only one of which is enabled. The first one simply disables itself and enables the next one, pause a while, and then enables itself and disables the second one. The second one disables itself, reenables the first one, and then performs the action.
The macro is very simple if you know any programming languages at all. If you were going to write this in a text programming language, it would look something like this:
NowControl = SECONDS(); // get the current time in seconds since boot.
if LastControl == "" then
LastControl = 0; // if the variable LastControl is undefined, set it to 0
end-if
if LastControl > NowControl - 1.0 then // if the last tap of the Control key happened less than 1.0 seconds ago
DoStuff();
end-if
LastControl = NowControl; // remember the time this tap of the Control key
Keyboard Maestro is simply a visual programming language. Ironically, I’d not actually in favor of visual programming languages for most purposes because, as seen above, the text version is not much harder to understand. The reason it works well in Keyboard Maestro is that the programming aspect is an addition, allowing you to stretch and amplify the power provided by the actions, and the actions in turn get a lot of power from their visual editing that would be much more challenging to do in a textual programming language.
So to answer your specific question:
The variable LastControl remembers the time at which you last tapped the control key (the last time this macro was run). If you made another version of this macro (eg Double Tap Command) you would need to use a different variable.
The variable NowControl is a temporary variable that holds the current time. It’s no longer needed as you could use the TRIGGERTIME() function instead - if LastControl > TRIGGERTTIME() - 1.0.
The “- 1.0” is “1 second ago”. It is the allowable amount of time for it to be considered a double tap of the control key as opposed to pressing it, waiting and then pressing it again.
For example, I set up right Shift as the key, and when I just write regularly (I mean using Shift key), KM will trigger the action.
Example: I called to Suzy.
@peternlewis Hi Peter, I've been using this double tap trigger very often for nearly 3 months, but recently (probably from last month) it stopped working whenever I put my Mac to sleep mode or screen saver mode. I had to unplug and replug the cable of my keyboard to get this trigger working right every time.
PS:
Keyboard Maestro version: 8.2.4 (newest up to now);
macOS system version: 10.13.6 (newest up to now).