diff options
| author | Ryan <fauxpark@gmail.com> | 2022-12-15 07:40:25 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-14 12:40:25 -0800 |
| commit | 1978007faefc0fb3af809ddf0d2ff1274e540570 (patch) | |
| tree | 76e3d5ce69f8f4892602c5cfb6b54374642e7c55 /tests | |
| parent | 83e8e5845a7136ade68bad82c156c70c071f9bf7 (diff) | |
Tap Dance: remove `qk_` prefix (#19313)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tap_dance/examples.c | 22 | ||||
| -rw-r--r-- | tests/tap_dance/tap_dance_layers/tap_dance_defs.c | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/tap_dance/examples.c b/tests/tap_dance/examples.c index 4a5be41b08..af74388209 100644 --- a/tests/tap_dance/examples.c +++ b/tests/tap_dance/examples.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | // Example 1 | 24 | // Example 1 |
| 25 | 25 | ||
| 26 | void dance_egg(qk_tap_dance_state_t *state, void *user_data) { | 26 | void dance_egg(tap_dance_state_t *state, void *user_data) { |
| 27 | if (state->count >= 100) { | 27 | if (state->count >= 100) { |
| 28 | // SEND_STRING("Safety dance!"); | 28 | // SEND_STRING("Safety dance!"); |
| 29 | tap_code(KC_C); | 29 | tap_code(KC_C); |
| @@ -34,7 +34,7 @@ void dance_egg(qk_tap_dance_state_t *state, void *user_data) { | |||
| 34 | 34 | ||
| 35 | // Example 2 | 35 | // Example 2 |
| 36 | 36 | ||
| 37 | void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { | 37 | void dance_flsh_each(tap_dance_state_t *state, void *user_data) { |
| 38 | switch (state->count) { | 38 | switch (state->count) { |
| 39 | case 1: | 39 | case 1: |
| 40 | register_code(KC_3); | 40 | register_code(KC_3); |
| @@ -54,14 +54,14 @@ void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { | |||
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { | 57 | void dance_flsh_finished(tap_dance_state_t *state, void *user_data) { |
| 58 | if (state->count >= 4) { | 58 | if (state->count >= 4) { |
| 59 | // reset_keyboard(); | 59 | // reset_keyboard(); |
| 60 | tap_code(KC_R); | 60 | tap_code(KC_R); |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { | 64 | void dance_flsh_reset(tap_dance_state_t *state, void *user_data) { |
| 65 | unregister_code(KC_1); | 65 | unregister_code(KC_1); |
| 66 | // wait_ms(50); | 66 | // wait_ms(50); |
| 67 | unregister_code(KC_2); | 67 | unregister_code(KC_2); |
| @@ -79,7 +79,7 @@ typedef struct { | |||
| 79 | } tap_dance_tap_hold_t; | 79 | } tap_dance_tap_hold_t; |
| 80 | 80 | ||
| 81 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 81 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 82 | qk_tap_dance_action_t *action; | 82 | tap_dance_action_t *action; |
| 83 | 83 | ||
| 84 | switch (keycode) { | 84 | switch (keycode) { |
| 85 | case TD(CT_CLN): | 85 | case TD(CT_CLN): |
| @@ -92,7 +92,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 92 | return true; | 92 | return true; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | void tap_dance_tap_hold_finished(qk_tap_dance_state_t *state, void *user_data) { | 95 | void tap_dance_tap_hold_finished(tap_dance_state_t *state, void *user_data) { |
| 96 | tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; | 96 | tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; |
| 97 | 97 | ||
| 98 | if (state->pressed) { | 98 | if (state->pressed) { |
| @@ -110,7 +110,7 @@ void tap_dance_tap_hold_finished(qk_tap_dance_state_t *state, void *user_data) { | |||
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | void tap_dance_tap_hold_reset(qk_tap_dance_state_t *state, void *user_data) { | 113 | void tap_dance_tap_hold_reset(tap_dance_state_t *state, void *user_data) { |
| 114 | tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; | 114 | tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data; |
| 115 | 115 | ||
| 116 | if (tap_hold->held) { | 116 | if (tap_hold->held) { |
| @@ -142,7 +142,7 @@ typedef struct { | |||
| 142 | td_state_t state; | 142 | td_state_t state; |
| 143 | } td_tap_t; | 143 | } td_tap_t; |
| 144 | 144 | ||
| 145 | td_state_t cur_dance(qk_tap_dance_state_t *state) { | 145 | td_state_t cur_dance(tap_dance_state_t *state) { |
| 146 | if (state->count == 1) { | 146 | if (state->count == 1) { |
| 147 | if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; | 147 | if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; |
| 148 | else return TD_SINGLE_HOLD; | 148 | else return TD_SINGLE_HOLD; |
| @@ -163,7 +163,7 @@ static td_tap_t xtap_state = { | |||
| 163 | .state = TD_NONE | 163 | .state = TD_NONE |
| 164 | }; | 164 | }; |
| 165 | 165 | ||
| 166 | void x_finished(qk_tap_dance_state_t *state, void *user_data) { | 166 | void x_finished(tap_dance_state_t *state, void *user_data) { |
| 167 | xtap_state.state = cur_dance(state); | 167 | xtap_state.state = cur_dance(state); |
| 168 | switch (xtap_state.state) { | 168 | switch (xtap_state.state) { |
| 169 | case TD_SINGLE_TAP: register_code(KC_X); break; | 169 | case TD_SINGLE_TAP: register_code(KC_X); break; |
| @@ -175,7 +175,7 @@ void x_finished(qk_tap_dance_state_t *state, void *user_data) { | |||
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | void x_reset(qk_tap_dance_state_t *state, void *user_data) { | 178 | void x_reset(tap_dance_state_t *state, void *user_data) { |
| 179 | switch (xtap_state.state) { | 179 | switch (xtap_state.state) { |
| 180 | case TD_SINGLE_TAP: unregister_code(KC_X); break; | 180 | case TD_SINGLE_TAP: unregister_code(KC_X); break; |
| 181 | case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break; | 181 | case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break; |
| @@ -188,7 +188,7 @@ void x_reset(qk_tap_dance_state_t *state, void *user_data) { | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | 190 | ||
| 191 | qk_tap_dance_action_t tap_dance_actions[] = { | 191 | tap_dance_action_t tap_dance_actions[] = { |
| 192 | [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), | 192 | [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), |
| 193 | [CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg), | 193 | [CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg), |
| 194 | [CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), | 194 | [CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), |
diff --git a/tests/tap_dance/tap_dance_layers/tap_dance_defs.c b/tests/tap_dance/tap_dance_layers/tap_dance_defs.c index 5ec900c041..fbe37f7ed0 100644 --- a/tests/tap_dance/tap_dance_layers/tap_dance_defs.c +++ b/tests/tap_dance/tap_dance_layers/tap_dance_defs.c | |||
| @@ -43,7 +43,7 @@ enum lt_app_state { | |||
| 43 | 43 | ||
| 44 | static enum lt_app_state saved_lt_app_state; | 44 | static enum lt_app_state saved_lt_app_state; |
| 45 | 45 | ||
| 46 | static enum lt_app_state get_lt_app_state(qk_tap_dance_state_t *state) { | 46 | static enum lt_app_state get_lt_app_state(tap_dance_state_t *state) { |
| 47 | if (state->count == 1) { | 47 | if (state->count == 1) { |
| 48 | if (!state->pressed) { | 48 | if (!state->pressed) { |
| 49 | return LTA_SINGLE_TAP; | 49 | return LTA_SINGLE_TAP; |
| @@ -57,7 +57,7 @@ static enum lt_app_state get_lt_app_state(qk_tap_dance_state_t *state) { | |||
| 57 | } | 57 | } |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | static void lt_app_finished(qk_tap_dance_state_t *state, void *user_data) { | 60 | static void lt_app_finished(tap_dance_state_t *state, void *user_data) { |
| 61 | saved_lt_app_state = get_lt_app_state(state); | 61 | saved_lt_app_state = get_lt_app_state(state); |
| 62 | switch (saved_lt_app_state) { | 62 | switch (saved_lt_app_state) { |
| 63 | case LTA_NONE: | 63 | case LTA_NONE: |
| @@ -74,7 +74,7 @@ static void lt_app_finished(qk_tap_dance_state_t *state, void *user_data) { | |||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static void lt_app_reset(qk_tap_dance_state_t *state, void *user_data) { | 77 | static void lt_app_reset(tap_dance_state_t *state, void *user_data) { |
| 78 | switch (saved_lt_app_state) { | 78 | switch (saved_lt_app_state) { |
| 79 | case LTA_NONE: | 79 | case LTA_NONE: |
| 80 | break; | 80 | break; |
| @@ -90,7 +90,7 @@ static void lt_app_reset(qk_tap_dance_state_t *state, void *user_data) { | |||
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | qk_tap_dance_action_t tap_dance_actions[] = { | 93 | tap_dance_action_t tap_dance_actions[] = { |
| 94 | [TD_L_MOVE] = ACTION_TAP_DANCE_LAYER_MOVE(KC_APP, 1), | 94 | [TD_L_MOVE] = ACTION_TAP_DANCE_LAYER_MOVE(KC_APP, 1), |
| 95 | [TD_L_TOGG] = ACTION_TAP_DANCE_LAYER_TOGGLE(KC_APP, 1), | 95 | [TD_L_TOGG] = ACTION_TAP_DANCE_LAYER_TOGGLE(KC_APP, 1), |
| 96 | [TD_LT_APP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lt_app_finished, lt_app_reset), | 96 | [TD_LT_APP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lt_app_finished, lt_app_reset), |
