summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_tap_dance.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.c')
-rw-r--r--quantum/process_keycode/process_tap_dance.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index 6e8e596673..fbe4ce1d33 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -18,8 +18,8 @@
static uint16_t active_td;
static uint16_t last_tap_time;
-void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
+void tap_dance_pair_on_each_tap(tap_dance_state_t *state, void *user_data) {
+ tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data;
if (state->count == 2) {
register_code16(pair->kc2);
@@ -27,14 +27,14 @@ void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data)
}
}
-void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
+void tap_dance_pair_finished(tap_dance_state_t *state, void *user_data) {
+ tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data;
register_code16(pair->kc1);
}
-void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
+void tap_dance_pair_reset(tap_dance_state_t *state, void *user_data) {
+ tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data;
if (state->count == 1) {
wait_ms(TAP_CODE_DELAY);
@@ -44,8 +44,8 @@ void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, void *user_data) {
}
}
-void qk_tap_dance_dual_role_on_each_tap(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data;
+void tap_dance_dual_role_on_each_tap(tap_dance_state_t *state, void *user_data) {
+ tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data;
if (state->count == 2) {
layer_move(pair->layer);
@@ -53,8 +53,8 @@ void qk_tap_dance_dual_role_on_each_tap(qk_tap_dance_state_t *state, void *user_
}
}
-void qk_tap_dance_dual_role_finished(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data;
+void tap_dance_dual_role_finished(tap_dance_state_t *state, void *user_data) {
+ tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data;
if (state->count == 1) {
register_code16(pair->kc);
@@ -63,8 +63,8 @@ void qk_tap_dance_dual_role_finished(qk_tap_dance_state_t *state, void *user_dat
}
}
-void qk_tap_dance_dual_role_reset(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data;
+void tap_dance_dual_role_reset(tap_dance_state_t *state, void *user_data) {
+ tap_dance_dual_role_t *pair = (tap_dance_dual_role_t *)user_data;
if (state->count == 1) {
wait_ms(TAP_CODE_DELAY);
@@ -72,13 +72,13 @@ void qk_tap_dance_dual_role_reset(qk_tap_dance_state_t *state, void *user_data)
}
}
-static inline void _process_tap_dance_action_fn(qk_tap_dance_state_t *state, void *user_data, qk_tap_dance_user_fn_t fn) {
+static inline void _process_tap_dance_action_fn(tap_dance_state_t *state, void *user_data, tap_dance_user_fn_t fn) {
if (fn) {
fn(state, user_data);
}
}
-static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *action) {
+static inline void process_tap_dance_action_on_each_tap(tap_dance_action_t *action) {
action->state.count++;
action->state.weak_mods = get_mods();
action->state.weak_mods |= get_weak_mods();
@@ -88,17 +88,17 @@ static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *a
_process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_tap);
}
-static inline void process_tap_dance_action_on_reset(qk_tap_dance_action_t *action) {
+static inline void process_tap_dance_action_on_reset(tap_dance_action_t *action) {
_process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_reset);
del_weak_mods(action->state.weak_mods);
#ifndef NO_ACTION_ONESHOT
del_mods(action->state.oneshot_mods);
#endif
send_keyboard_report();
- action->state = (const qk_tap_dance_state_t){0};
+ action->state = (const tap_dance_state_t){0};
}
-static inline void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) {
+static inline void process_tap_dance_action_on_dance_finished(tap_dance_action_t *action) {
if (!action->state.finished) {
action->state.finished = true;
add_weak_mods(action->state.weak_mods);
@@ -116,7 +116,7 @@ static inline void process_tap_dance_action_on_dance_finished(qk_tap_dance_actio
}
bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) {
- qk_tap_dance_action_t *action;
+ tap_dance_action_t *action;
if (!record->event.pressed) return false;
@@ -139,7 +139,7 @@ bool preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) {
}
bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
- qk_tap_dance_action_t *action;
+ tap_dance_action_t *action;
switch (keycode) {
case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
@@ -163,7 +163,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
}
void tap_dance_task() {
- qk_tap_dance_action_t *action;
+ tap_dance_action_t *action;
if (!active_td || timer_elapsed(last_tap_time) <= GET_TAPPING_TERM(active_td, &(keyrecord_t){})) return;
@@ -173,7 +173,7 @@ void tap_dance_task() {
}
}
-void reset_tap_dance(qk_tap_dance_state_t *state) {
+void reset_tap_dance(tap_dance_state_t *state) {
active_td = 0;
- process_tap_dance_action_on_reset((qk_tap_dance_action_t *)state);
+ process_tap_dance_action_on_reset((tap_dance_action_t *)state);
}