This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
trigger:Hot_Key [2023/09/13 00:26] peternlewis |
trigger:Hot_Key [2025/03/03 21:00] (current) peternlewis [When] |
||
---|---|---|---|
Line 15: | Line 15: | ||
You can configure the hot key trigger to execute the macro when the key is pressed, when it is long pressed (v10.0+), when it is released, or repeatedly while the key is held down. This allows you to do things like have a macro execute when the key is pressed, and then a second macro execute when the key is released, for example to toggle a setting on and then off again. | You can configure the hot key trigger to execute the macro when the key is pressed, when it is long pressed (v10.0+), when it is released, or repeatedly while the key is held down. This allows you to do things like have a macro execute when the key is pressed, and then a second macro execute when the key is released, for example to toggle a setting on and then off again. | ||
- | You can configure the hot key trigger to execute when the key is tapped (press and released quickly) each time, the first tap, double tapped, triple tapped, or quadruple tapped (v7.0+). | + | You can configure the hot key trigger to execute when the key is tapped (press and released quickly) each time, the first tap, double tapped, triple tapped, or quadruple tapped (v7.0+). |
You can configure the hot key trigger to execute when the key is tapped (press and released quickly) only on the first tap, or the second tap, or the third tap, or the fourth tap (v11.0+). Keep in mind that Keyboard Maestro cannot see the future, so to determine that this is explicitly the second tap, the macro will not fire when the key is released, but must wait a short period of time to see that it is not pressed a third time. As such there will be a short delay before the macro is executed when using the “only once” style options. | You can configure the hot key trigger to execute when the key is tapped (press and released quickly) only on the first tap, or the second tap, or the third tap, or the fourth tap (v11.0+). Keep in mind that Keyboard Maestro cannot see the future, so to determine that this is explicitly the second tap, the macro will not fire when the key is released, but must wait a short period of time to see that it is not pressed a third time. As such there will be a short delay before the macro is executed when using the “only once” style options. | ||
Line 22: | Line 22: | ||
(!) Note that whether or not a key typed by Keyboard Maestro itself will trigger a hot key (and thus be swallowed and execute a macro) or not (and thus go through to the application) is not defined - either behaviour may happen and which behaviour happens will vary depending on many unpredictable factors though Keyboard Maestro will try to ensure no macro is triggered in response to its own typing. If you wish to trigger a macro based on a keystroke, you can use the [[action:Trigger_Macros_by_Hot_Key|Trigger Macros by Hot Key]] action. | (!) Note that whether or not a key typed by Keyboard Maestro itself will trigger a hot key (and thus be swallowed and execute a macro) or not (and thus go through to the application) is not defined - either behaviour may happen and which behaviour happens will vary depending on many unpredictable factors though Keyboard Maestro will try to ensure no macro is triggered in response to its own typing. If you wish to trigger a macro based on a keystroke, you can use the [[action:Trigger_Macros_by_Hot_Key|Trigger Macros by Hot Key]] action. | ||
+ | |||
+ | ^ Selection ^ Behaviour ^ | ||
+ | | is pressed | when the key is pressed | | ||
+ | | is long pressed | when the key is released if it was down for a long time | | ||
+ | | is down | when the key is pressed and periodically while it remains down | | ||
+ | | is released | when the key is released | | ||
+ | | is tapped | when the key is released if it was down for a short time | | ||
+ | | is tapped once | when the key is tapped and has not been tapped recently | | ||
+ | | is tapped only once | a short while after the key has been tapped if it has not been pressed again | | ||
+ | | is tapped twice | when the key is tapped twice and has not been tapped three or more times | | ||
+ | | is tapped only twice | a short while after the key has been tapped twice if it has not been pressed again | | ||
+ | | is tapped 3 times | as twice, but 3 times | | ||
+ | | is tapped only 3 times | as only twice, but 3 times | | ||
+ | | is tapped 4 times | as twice, but 4 times | | ||
+ | | is tapped only 4 times | as only twice, but 4 times | | ||
+ | |||
+ | So for example if you tab the key three times in quick succession, these triggers would happen: | ||
+ | |||
+ | * is pressed | ||
+ | * is released, is tapped, and is tapped once. | ||
+ | * is pressed | ||
+ | * is released, is tapped, and is tapped twice. | ||
+ | * is pressed | ||
+ | * is released, is tapped, and is tapped 3 times. | ||
Modifiers alone (eg just Control) cannot be used as a hot key, although you can use the [[trigger:USB_Device_Key]] trigger to detect modifier key presses as well as other button presses like the mouse buttons or keys on non-standard keyboards like the XK-24. | Modifiers alone (eg just Control) cannot be used as a hot key, although you can use the [[trigger:USB_Device_Key]] trigger to detect modifier key presses as well as other button presses like the mouse buttons or keys on non-standard keyboards like the XK-24. | ||
Line 49: | Line 73: | ||
===== See Also ===== | ===== See Also ===== | ||
- | === Triggers === | + | === Triggers === |
* [USB Device Key](https://wiki.keyboardmaestro.com/trigger/USB_Device_Key) trigger | * [USB Device Key](https://wiki.keyboardmaestro.com/trigger/USB_Device_Key) trigger | ||
Line 68: | Line 92: | ||
* [[:Tokens|See all Tokens]] | * [[:Tokens|See all Tokens]] | ||
- | ==== Forum ==== | + | === Forum === |
* [A Type a Key action can trigger another macro](https://forum.keyboardmaestro.com/t/tip-a-type-a-key-action-can-trigger-another-macro/3633/2) | * [A Type a Key action can trigger another macro](https://forum.keyboardmaestro.com/t/tip-a-type-a-key-action-can-trigger-another-macro/3633/2) | ||