diff options
author | leep-frog <66687468+leep-frog@users.noreply.github.com> | 2023-07-27 00:04:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 21:04:35 -0700 |
commit | 2c70d3891002337ef981a478b95c621f68dfd777 (patch) | |
tree | 537fdd4df00101b3a6a446383254363613af538b /tests/tap_dance/examples.c | |
parent | 821db155f20f441c2d3aa6ff4e10878bfccdf45c (diff) |
On-each-release tap dance function (#20255)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Diffstat (limited to 'tests/tap_dance/examples.c')
-rw-r--r-- | tests/tap_dance/examples.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/tap_dance/examples.c b/tests/tap_dance/examples.c index af74388209..13086bbb4b 100644 --- a/tests/tap_dance/examples.c +++ b/tests/tap_dance/examples.c @@ -187,13 +187,35 @@ void x_reset(tap_dance_state_t *state, void *user_data) { xtap_state.state = TD_NONE; } +static void release_press(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_P); +} + +static void release_unpress(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_U); +} + +static void release_unpress_mark_finished(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_U); + state->finished = true; +} + +static void release_finished(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_F); +} + +static void release_reset(tap_dance_state_t *state, void *user_data) { + tap_code16(KC_R); +} tap_dance_action_t tap_dance_actions[] = { [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), [CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg), [CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), [CT_CLN] = ACTION_TAP_DANCE_TAP_HOLD(KC_COLN, KC_SCLN), - [X_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset) + [X_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset), + [TD_RELEASE] = ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(release_press, release_unpress, release_finished, release_reset), + [TD_RELEASE_AND_FINISH] = ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(release_press, release_unpress_mark_finished, release_finished, release_reset), }; // clang-format on |