forked from mirror/qmk_firmware
Tap Dance: remove qk_ prefix (#19313)
This commit is contained in:
@@ -57,7 +57,7 @@ enum bdn9_dances {
|
||||
TD_DTAP_ADJT
|
||||
};
|
||||
// Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_DTAP_ADIO] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _AUDIO),
|
||||
[TD_DTAP_LGHT] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _LIGHT),
|
||||
[TD_DTAP_ADJT] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _ADJUST),
|
||||
|
||||
@@ -48,11 +48,11 @@ static td_state_t td_state;
|
||||
// declare your tapdance functions:
|
||||
|
||||
// function to determine the current tapdance state
|
||||
int cur_dance (qk_tap_dance_state_t *state);
|
||||
int cur_dance (tap_dance_state_t *state);
|
||||
|
||||
// `finished` and `reset` functions for each tapdance keycode
|
||||
void altlp_finished (qk_tap_dance_state_t *state, void *user_data);
|
||||
void altlp_reset (qk_tap_dance_state_t *state, void *user_data);
|
||||
void altlp_finished (tap_dance_state_t *state, void *user_data);
|
||||
void altlp_reset (tap_dance_state_t *state, void *user_data);
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
@@ -137,7 +137,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
// Tapdance! Hold to use as a modifier to the _MOD layout, tap to change it between _BASE and _MACRO
|
||||
|
||||
// determine the tapdance state to return
|
||||
int cur_dance (qk_tap_dance_state_t *state) {
|
||||
int cur_dance (tap_dance_state_t *state) {
|
||||
if (state->count == 1) {
|
||||
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
|
||||
else { return SINGLE_HOLD; }
|
||||
@@ -146,7 +146,7 @@ int cur_dance (qk_tap_dance_state_t *state) {
|
||||
|
||||
// handle the possible states for each tapdance keycode you define:
|
||||
|
||||
void altlp_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void altlp_finished (tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -158,7 +158,7 @@ void altlp_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void altlp_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void altlp_reset (tap_dance_state_t *state, void *user_data) {
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
break;
|
||||
@@ -169,6 +169,6 @@ void altlp_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
|
||||
// define `ACTION_TAP_DANCE_FN_ADVANCED()` for each tapdance keycode, passing in `finished` and `reset` functions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[LAY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset)
|
||||
};
|
||||
|
||||
@@ -47,20 +47,20 @@ enum {
|
||||
PSLPAS
|
||||
};
|
||||
|
||||
void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_finished(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_on(_ADJUST2);
|
||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
||||
}
|
||||
}
|
||||
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_off(_ADJUST2);
|
||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer
|
||||
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap
|
||||
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||
|
||||
@@ -36,20 +36,20 @@ enum {
|
||||
PSPA
|
||||
};
|
||||
|
||||
void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_finished(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_on(_ADJUST2);
|
||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
||||
}
|
||||
}
|
||||
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_off(_ADJUST2);
|
||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer
|
||||
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap
|
||||
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||
|
||||
@@ -36,7 +36,7 @@ enum custom_tapdances {
|
||||
TD_SHFT_CAPS = 0,
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_SHFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), //shift if pressed 1x, caps lock if pressed 2x
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ enum keycodes {
|
||||
KC_KAK = SAFE_RANGE,
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[_LCTLGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_LGUI),
|
||||
};
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
// Shift vs. capslock function. From bbaserdem's Planck keymap (since deprecated).
|
||||
void caps_tap (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void caps_tap (tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
register_code (KC_LSFT);
|
||||
} else if (state->count == 2) {
|
||||
@@ -134,7 +134,7 @@ void caps_tap (qk_tap_dance_state_t *state, void *user_data) {
|
||||
register_code (KC_CAPS);
|
||||
}
|
||||
}
|
||||
void caps_tap_end (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void caps_tap_end (tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
unregister_code (KC_LSFT);
|
||||
} else {
|
||||
@@ -142,7 +142,7 @@ void caps_tap_end (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for Shift, twice for Caps Lock
|
||||
[SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end)
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
)
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ enum {
|
||||
TD_SCL = 0
|
||||
};
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for Shift, twice for Caps Lock
|
||||
[TD_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ enum custom_keycodes {
|
||||
enum {
|
||||
TD_S
|
||||
};
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_S] = ACTION_TAP_DANCE_DOUBLE(KC_S, KC_Z),
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ enum tapdances {
|
||||
*
|
||||
* To use this in the configurator, enter the name 'TD_FIVE_ENTER' in the "Any" key.
|
||||
*/
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
/* Tap once for 5, twice for Enter. */
|
||||
[_TD_FIVE_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
||||
};
|
||||
|
||||
@@ -43,20 +43,20 @@ enum {
|
||||
PSLPAS
|
||||
};
|
||||
|
||||
void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_finished(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_on(_ADJUST2);
|
||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
||||
}
|
||||
}
|
||||
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_off(_ADJUST2);
|
||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer
|
||||
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap
|
||||
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||
|
||||
@@ -34,20 +34,20 @@ enum {
|
||||
PSPA
|
||||
};
|
||||
|
||||
void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_finished(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_on(_ADJUST2);
|
||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
||||
}
|
||||
}
|
||||
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dance_LAYER_reset(tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_off(_ADJUST2);
|
||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer
|
||||
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap
|
||||
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||
|
||||
Reference in New Issue
Block a user