Skip to content

Commit

Permalink
Add tap_code function (qmk#3784)
Browse files Browse the repository at this point in the history
* Add tap_code

* formatting

* Doc clarification

* Rename variable to make more consistent
  • Loading branch information
drashna authored and jackhumbert committed Oct 2, 2018
1 parent e885c79 commit 26f4e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/feature_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ This sends the `<kc>` keydown event to the computer. Some examples would be `KC_
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.
### `tap_code(<kc>);`
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).
### `clear_keyboard();`
This will clear all mods and keys currently pressed.
Expand Down
1 change: 1 addition & 0 deletions tmk_core/common/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void process_record(keyrecord_t *record);
void process_action(keyrecord_t *record, action_t action);
void register_code(uint8_t code);
void unregister_code(uint8_t code);
inline void tap_code(uint8_t code) { register_code(code); unregister_code(code); }
void register_mods(uint8_t mods);
void unregister_mods(uint8_t mods);
//void set_mods(uint8_t mods);
Expand Down

0 comments on commit 26f4e70

Please sign in to comment.