Tap Dance: remove qk_
prefix (#19313)
This commit is contained in:
@@ -196,7 +196,7 @@ layer_state_t layer_state_set_user(layer_state_t state);
|
||||
// Method called at the end of the tap dance on the TAP_MACRO key. That key is
|
||||
// used to start recording a macro (double tap or more), to stop recording (any
|
||||
// number of tap), or to play the recorded macro (1 tap).
|
||||
void macro_tapdance_fn(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void macro_tapdance_fn(tap_dance_state_t *state, void *user_data) {
|
||||
uint16_t keycode;
|
||||
keyrecord_t record;
|
||||
dprintf("macro_tap_dance_fn %d\n", state->count);
|
||||
@@ -219,7 +219,7 @@ void macro_tapdance_fn(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
|
||||
// The definition of the tap dance actions:
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
// This Tap dance plays the macro 1 on TAP and records it on double tap.
|
||||
[TAP_MACRO] = ACTION_TAP_DANCE_FN(macro_tapdance_fn),
|
||||
};
|
||||
|
@@ -104,7 +104,7 @@ layer_state_t layer_state_set_user(layer_state_t state);
|
||||
// Method called at the end of the tap dance on the TAP_MACRO key. That key is
|
||||
// used to start recording a macro (double tap or more), to stop recording (any
|
||||
// number of tap), or to play the recorded macro (1 tap).
|
||||
void macro_tapdance_fn(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void macro_tapdance_fn(tap_dance_state_t *state, void *user_data) {
|
||||
uint16_t keycode;
|
||||
keyrecord_t record;
|
||||
dprintf("macro_tap_dance_fn %d\n", state->count);
|
||||
@@ -127,7 +127,7 @@ void macro_tapdance_fn(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
|
||||
// The definition of the tap dance actions:
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
// This Tap dance plays the macro 1 on TAP and records it on double tap.
|
||||
[TAP_MACRO] = ACTION_TAP_DANCE_FN(macro_tapdance_fn)
|
||||
};
|
||||
|
@@ -4,7 +4,7 @@ static tap dot_comm_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void dot_comm_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dot_comm_finished(tap_dance_state_t *state, void *user_data) {
|
||||
dot_comm_state.state = current_dance(state);
|
||||
switch (dot_comm_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -22,7 +22,7 @@ void dot_comm_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void dot_comm_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void dot_comm_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (dot_comm_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_DOT);
|
||||
|
@@ -4,7 +4,7 @@ static tap h_mouse_gui_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void h_mouse_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void h_mouse_gui_finished(tap_dance_state_t *state, void *user_data) {
|
||||
h_mouse_gui_state.state = current_dance(state);
|
||||
switch (h_mouse_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -21,7 +21,7 @@ void h_mouse_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void h_mouse_gui_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void h_mouse_gui_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (h_mouse_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_H);
|
||||
|
@@ -4,7 +4,7 @@ static tap j_media_meh_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void j_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void j_media_meh_finished(tap_dance_state_t *state, void *user_data) {
|
||||
j_media_meh_state.state = current_dance(state);
|
||||
switch (j_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -23,7 +23,7 @@ void j_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void j_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void j_media_meh_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (j_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_J);
|
||||
|
@@ -4,7 +4,7 @@ static tap k_numpad_hyper_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void k_numpad_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void k_numpad_hyper_finished(tap_dance_state_t *state, void *user_data) {
|
||||
k_numpad_hyper_state.state = current_dance(state);
|
||||
switch (k_numpad_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -24,7 +24,7 @@ void k_numpad_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void k_numpad_hyper_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void k_numpad_hyper_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (k_numpad_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_K);
|
||||
|
@@ -4,7 +4,7 @@ static tap m_chords_hyper_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void m_chords_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void m_chords_hyper_finished(tap_dance_state_t *state, void *user_data) {
|
||||
m_chords_hyper_state.state = current_dance(state);
|
||||
switch (m_chords_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -24,7 +24,7 @@ void m_chords_hyper_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void m_chords_hyper_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void m_chords_hyper_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (m_chords_hyper_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_M);
|
||||
|
@@ -4,7 +4,7 @@ static tap none_lead_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void none_lead_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void none_lead_finished(tap_dance_state_t *state, void *user_data) {
|
||||
none_lead_state.state = current_dance(state);
|
||||
switch (none_lead_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -22,7 +22,7 @@ void none_lead_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void none_lead_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void none_lead_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (none_lead_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_NO);
|
||||
|
@@ -4,7 +4,7 @@ static tap quot_dquot_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void quot_dquot_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void quot_dquot_finished(tap_dance_state_t *state, void *user_data) {
|
||||
quot_dquot_state.state = current_dance(state);
|
||||
switch (quot_dquot_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -22,7 +22,7 @@ void quot_dquot_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void quot_dquot_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void quot_dquot_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (quot_dquot_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_QUOT);
|
||||
|
@@ -4,7 +4,7 @@ static tap scln_coln_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void scln_coln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void scln_coln_finished(tap_dance_state_t *state, void *user_data) {
|
||||
scln_coln_state.state = current_dance(state);
|
||||
switch (scln_coln_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -23,7 +23,7 @@ void scln_coln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void scln_coln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void scln_coln_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (scln_coln_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_SCLN);
|
||||
|
@@ -4,7 +4,7 @@ static tap u_arrows_gui_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void u_arrows_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void u_arrows_gui_finished(tap_dance_state_t *state, void *user_data) {
|
||||
u_arrows_gui_state.state = current_dance(state);
|
||||
switch (u_arrows_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -21,7 +21,7 @@ void u_arrows_gui_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void u_arrows_gui_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void u_arrows_gui_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (u_arrows_gui_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_U);
|
||||
|
@@ -4,7 +4,7 @@ static tap w_media_meh_state = {
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void w_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void w_media_meh_finished(tap_dance_state_t *state, void *user_data) {
|
||||
w_media_meh_state.state = current_dance(state);
|
||||
switch (w_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -23,7 +23,7 @@ void w_media_meh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void w_media_meh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
void w_media_meh_reset(tap_dance_state_t *state, void *user_data) {
|
||||
switch (w_media_meh_state.state) {
|
||||
case SINGLE_TAP:
|
||||
unregister_code(KC_W);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// Register the double tap dances:
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
tap_dance_action_t tap_dance_actions[] = {
|
||||
[EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS),
|
||||
[MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),
|
||||
[SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS),
|
||||
|
@@ -41,7 +41,7 @@ enum {
|
||||
* For the third point, there does exist the 'DOUBLE_SINGLE_TAP', however this is not fully tested
|
||||
*
|
||||
*/
|
||||
int current_dance(qk_tap_dance_state_t *state) {
|
||||
int current_dance(tap_dance_state_t *state) {
|
||||
int current_state = 0;
|
||||
if (state->count == 1) {
|
||||
if (state->interrupted || !state->pressed) {
|
||||
|
@@ -53,15 +53,15 @@ 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 ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data);
|
||||
void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data);
|
||||
void altto11_finished (qk_tap_dance_state_t *state, void *user_data);
|
||||
void altto11_reset (qk_tap_dance_state_t *state, void *user_data);
|
||||
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data);
|
||||
void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data);
|
||||
void ctrlto12_finished (tap_dance_state_t *state, void *user_data);
|
||||
void ctrlto12_reset (tap_dance_state_t *state, void *user_data);
|
||||
void altto11_finished (tap_dance_state_t *state, void *user_data);
|
||||
void altto11_reset (tap_dance_state_t *state, void *user_data);
|
||||
void shiftto13_finished (tap_dance_state_t *state, void *user_data);
|
||||
void shiftto13_reset (tap_dance_state_t *state, void *user_data);
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@@ -257,7 +257,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
};
|
||||
|
||||
// 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 && state->interrupting_keycode == KC_MS_BTN1) {return SINGLE_HOLD;}
|
||||
if (state->interrupted && state->pressed && state->interrupting_keycode == 22273) {return SINGLE_HOLD;}
|
||||
@@ -277,7 +277,7 @@ int cur_dance (qk_tap_dance_state_t *state) {
|
||||
else { return 2; } // any number higher than the maximum state value you return above
|
||||
}
|
||||
// /* Backup in case previous code is hard to piece together. */
|
||||
// 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; }
|
||||
@@ -285,7 +285,7 @@ int cur_dance (qk_tap_dance_state_t *state) {
|
||||
// else { return 2; } // any number higher than the maximum state value you return above
|
||||
// }
|
||||
|
||||
void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void ctrlto12_finished (tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -304,7 +304,7 @@ void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void ctrlto12_reset (tap_dance_state_t *state, void *user_data) {
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
break;
|
||||
@@ -321,7 +321,7 @@ void ctrlto12_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void shiftto13_finished (tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -340,7 +340,7 @@ void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void shiftto13_reset (tap_dance_state_t *state, void *user_data) {
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
break;
|
||||
@@ -357,7 +357,7 @@ void shiftto13_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void altto11_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void altto11_finished (tap_dance_state_t *state, void *user_data) {
|
||||
td_state = cur_dance(state);
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
@@ -372,7 +372,7 @@ void altto11_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void altto11_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
void altto11_reset (tap_dance_state_t *state, void *user_data) {
|
||||
switch (td_state) {
|
||||
case SINGLE_TAP:
|
||||
break;
|
||||
@@ -386,7 +386,7 @@ void altto11_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[] = {
|
||||
[CTRL_TO12] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlto12_finished, ctrlto12_reset),
|
||||
[SHIFT_TO13] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, shiftto13_finished, shiftto13_reset),
|
||||
[ALT_TO11] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altto11_finished, altto11_reset),
|
||||
|
@@ -268,7 +268,7 @@ layer_state_t layer_state_set_user_keymap(layer_state_t state) {
|
||||
// tap dances
|
||||
|
||||
// flash keyboard on 4x tap, with leds
|
||||
// void flash_each_tap(qk_tap_dance_state_t *state, void *user_data) {
|
||||
// void flash_each_tap(tap_dance_state_t *state, void *user_data) {
|
||||
// switch (state->count) {
|
||||
// case 1:
|
||||
// ergodox_right_led_3_on();
|
||||
@@ -289,14 +289,14 @@ layer_state_t layer_state_set_user_keymap(layer_state_t state) {
|
||||
// }
|
||||
// }
|
||||
|
||||
// void flash_dance_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
// void flash_dance_finished(tap_dance_state_t *state, void *user_data) {
|
||||
// if (state->count >= 4) {
|
||||
// reset_keyboard();
|
||||
// reset_tap_dance(state);
|
||||
// }
|
||||
// }
|
||||
|
||||
// void flash_dance_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
// void flash_dance_reset(tap_dance_state_t *state, void *user_data) {
|
||||
// ergodox_right_led_1_off();
|
||||
// wait_ms(50);
|
||||
// ergodox_right_led_2_off();
|
||||
@@ -305,7 +305,7 @@ layer_state_t layer_state_set_user_keymap(layer_state_t state) {
|
||||
// }
|
||||
|
||||
// SYSCTL on first tap, MOUSE ON second tap
|
||||
// void layers_dance_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
// void layers_dance_finished(tap_dance_state_t *state, void *user_data) {
|
||||
// uint8_t layer = get_highest_layer(layer_state);
|
||||
|
||||
// switch(state->count) {
|
||||
@@ -328,7 +328,7 @@ layer_state_t layer_state_set_user_keymap(layer_state_t state) {
|
||||
// }
|
||||
// }
|
||||
|
||||
// qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
// tap_dance_action_t tap_dance_actions[] = {
|
||||
// [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ),
|
||||
// [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ),
|
||||
// };
|
||||
|
Reference in New Issue
Block a user