mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-05 23:24:17 -04:00
Tap Dance: remove qk_
prefix (#19313)
This commit is contained in:
parent
08bf316537
commit
b33d324a3d
3 changed files with 16 additions and 16 deletions
|
@ -46,15 +46,15 @@ enum custom_keycodes {
|
||||||
VSCODE,
|
VSCODE,
|
||||||
};
|
};
|
||||||
|
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state);
|
td_state_t cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
/* Quad layer switching */
|
/* Quad layer switching */
|
||||||
void layer_finished(qk_tap_dance_state_t *state, void *user_data);
|
void layer_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void layer_reset(qk_tap_dance_state_t *state, void *user_data);
|
void layer_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
/* Copy, paste, select all, cut */
|
/* Copy, paste, select all, cut */
|
||||||
void cvxa_finished(qk_tap_dance_state_t *state, void *user_data);
|
void cvxa_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void cvxa_reset(qk_tap_dance_state_t *state, void *user_data);
|
void cvxa_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static td_tap_t layerTap_state = {
|
static td_tap_t layerTap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
|
@ -67,7 +67,7 @@ static td_tap_t cvxa_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determine the current tap dance state
|
// Determine the current tap dance state
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state) {
|
td_state_t cur_dance(tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->interrupted || !state->pressed) return TD_SINGLE_TAP;
|
if (state->interrupted || !state->pressed) return TD_SINGLE_TAP;
|
||||||
// Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'.
|
// Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'.
|
||||||
|
@ -79,7 +79,7 @@ td_state_t cur_dance(qk_tap_dance_state_t *state) {
|
||||||
} else return TD_UNKNOWN;
|
} else return TD_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void layer_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void layer_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
layerTap_state.state = cur_dance(state);
|
layerTap_state.state = cur_dance(state);
|
||||||
layer_off(get_highest_layer(layer_state));
|
layer_off(get_highest_layer(layer_state));
|
||||||
switch (layerTap_state.state) {
|
switch (layerTap_state.state) {
|
||||||
|
@ -91,11 +91,11 @@ void layer_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void layer_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void layer_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
layerTap_state.state = TD_NONE;
|
layerTap_state.state = TD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cvxa_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void cvxa_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
cvxa_state.state = cur_dance(state);
|
cvxa_state.state = cur_dance(state);
|
||||||
register_mods(MOD_BIT(KC_LCTL));
|
register_mods(MOD_BIT(KC_LCTL));
|
||||||
switch (cvxa_state.state) {
|
switch (cvxa_state.state) {
|
||||||
|
@ -108,12 +108,12 @@ void cvxa_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
unregister_mods(MOD_BIT(KC_LCTL));
|
unregister_mods(MOD_BIT(KC_LCTL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cvxa_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void cvxa_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
cvxa_state.state = TD_NONE;
|
cvxa_state.state = TD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tap Dance definitions
|
// Tap Dance definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_CUT_REDO] = ACTION_TAP_DANCE_DOUBLE(C(KC_Z), S(C(KC_Z))),
|
[TD_CUT_REDO] = ACTION_TAP_DANCE_DOUBLE(C(KC_Z), S(C(KC_Z))),
|
||||||
[TD_PLAY_PAUSE_MUTE] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_MUTE),
|
[TD_PLAY_PAUSE_MUTE] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_MUTE),
|
||||||
[TD_MNXT_RIGHT] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_RIGHT),
|
[TD_MNXT_RIGHT] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_RIGHT),
|
||||||
|
|
|
@ -32,7 +32,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_cln_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
uprintf("Tap Dance count: %u", state->count);
|
uprintf("Tap Dance count: %u", state->count);
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_MPLY);
|
tap_code(KC_MPLY);
|
||||||
|
@ -44,7 +44,7 @@ void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All tap dance functions would go here. Only showing this one. */
|
/* All tap dance functions would go here. Only showing this one. */
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_PLAY_FORWARD_BACK] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, NULL),
|
[TD_PLAY_FORWARD_BACK] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, NULL),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void dance_enc_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_enc_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code(KC_MPLY);
|
register_code(KC_MPLY);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -69,7 +69,7 @@ void dance_enc_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_enc_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_enc_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
unregister_code(KC_MPLY);
|
unregister_code(KC_MPLY);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -80,7 +80,7 @@ void dance_enc_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tap Dance definitions
|
// Tap Dance definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[ENC_TAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_enc_finished, dance_enc_reset),
|
[ENC_TAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_enc_finished, dance_enc_reset),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue