forked from mirrors/qmk_userspace
tap-dance: Support for holding keys
With this change, tap dance will now store the pressed state of the tap-dance key, and allow one to make an action sooner, while the key is still held, and only unregister when the key is released. The registration must happen in the `on_dance_finished` callback, while unregistering goes to `on_reset`. The surrounding code makes sure not to call either multiple times. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
parent
8e1d96983a
commit
70e42489de
2 changed files with 12 additions and 1 deletions
|
@ -11,6 +11,8 @@ typedef struct
|
|||
uint8_t count;
|
||||
uint16_t keycode;
|
||||
uint16_t timer;
|
||||
bool active:1;
|
||||
bool pressed:1;
|
||||
} qk_tap_dance_state_t;
|
||||
|
||||
#define TD(n) (QK_TAP_DANCE + n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue