diff options
author | Gergely Nagy <algernon@madhouse-project.org> | 2016-07-20 10:22:52 +0200 |
---|---|---|
committer | Gergely Nagy <algernon@madhouse-project.org> | 2016-07-22 09:10:17 +0200 |
commit | 70e42489dec375e558d8e81ed5ebfb69b4f3dbd9 (patch) | |
tree | e420a956ac4a09848eb5df5a766861cfbaca8de5 /quantum/process_keycode/process_tap_dance.h | |
parent | 8e1d96983aad19b3e4e72ece5db822e92d91342b (diff) | |
download | qmk_firmware-70e42489dec375e558d8e81ed5ebfb69b4f3dbd9.tar.gz qmk_firmware-70e42489dec375e558d8e81ed5ebfb69b4f3dbd9.zip |
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>
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.h')
-rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 7b820584a8..d457db9b3c 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -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) |