summaryrefslogtreecommitdiff
path: root/tests/tap_dance/examples.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tap_dance/examples.c')
-rw-r--r--tests/tap_dance/examples.c24
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