diff options
-rw-r--r-- | docs/feature_macros.md | 4 | ||||
-rw-r--r-- | tmk_core/common/action.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 673153081..ba5d91882 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md | |||
@@ -228,6 +228,10 @@ This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ | |||
228 | 228 | ||
229 | Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent. | 229 | Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent. |
230 | 230 | ||
231 | ### `tap_code(<kc>);` | ||
232 | |||
233 | This will send `register_code(<kc>)` and then `unregister_code(<kc>)`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). | ||
234 | |||
231 | ### `clear_keyboard();` | 235 | ### `clear_keyboard();` |
232 | 236 | ||
233 | This will clear all mods and keys currently pressed. | 237 | This will clear all mods and keys currently pressed. |
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 0322c73ed..833febe9c 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h | |||
@@ -88,6 +88,7 @@ void process_record(keyrecord_t *record); | |||
88 | void process_action(keyrecord_t *record, action_t action); | 88 | void process_action(keyrecord_t *record, action_t action); |
89 | void register_code(uint8_t code); | 89 | void register_code(uint8_t code); |
90 | void unregister_code(uint8_t code); | 90 | void unregister_code(uint8_t code); |
91 | inline void tap_code(uint8_t code) { register_code(code); unregister_code(code); } | ||
91 | void register_mods(uint8_t mods); | 92 | void register_mods(uint8_t mods); |
92 | void unregister_mods(uint8_t mods); | 93 | void unregister_mods(uint8_t mods); |
93 | //void set_mods(uint8_t mods); | 94 | //void set_mods(uint8_t mods); |