Tap Dance: remove `qk_` prefix (#19313)
parent
83e8e5845a
commit
1978007fae
|
@ -64,7 +64,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance definitions
|
// Tap Dance definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Escape, twice for Caps Lock
|
// Tap once for Escape, twice for Caps Lock
|
||||||
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
||||||
};
|
};
|
||||||
|
@ -96,14 +96,14 @@ enum {
|
||||||
#### Example 1: Send "Safety Dance!" After 100 Taps :id=example-1
|
#### Example 1: Send "Safety Dance!" After 100 Taps :id=example-1
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void dance_egg(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_egg(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 100) {
|
if (state->count >= 100) {
|
||||||
SEND_STRING("Safety dance!");
|
SEND_STRING("Safety dance!");
|
||||||
reset_tap_dance(state);
|
reset_tap_dance(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -113,7 +113,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
```c
|
```c
|
||||||
// On each tap, light up one LED, from right to left
|
// On each tap, light up one LED, from right to left
|
||||||
// On the fourth tap, turn them off from right to left
|
// On the fourth tap, turn them off from right to left
|
||||||
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_flsh_each(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
ergodox_right_led_3_on();
|
ergodox_right_led_3_on();
|
||||||
|
@ -134,14 +134,14 @@ void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// On the fourth tap, set the keyboard on flash state
|
// On the fourth tap, set the keyboard on flash state
|
||||||
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_flsh_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 4) {
|
if (state->count >= 4) {
|
||||||
reset_keyboard();
|
reset_keyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the flash state didn't happen, then turn off LEDs, left to right
|
// If the flash state didn't happen, then turn off LEDs, left to right
|
||||||
void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_flsh_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
ergodox_right_led_1_off();
|
ergodox_right_led_1_off();
|
||||||
wait_ms(50);
|
wait_ms(50);
|
||||||
ergodox_right_led_2_off();
|
ergodox_right_led_2_off();
|
||||||
|
@ -150,7 +150,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// All tap dances now put together. Example 2 is "CT_FLSH"
|
// All tap dances now put together. Example 2 is "CT_FLSH"
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
||||||
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
||||||
[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
||||||
|
@ -169,7 +169,7 @@ typedef struct {
|
||||||
} tap_dance_tap_hold_t;
|
} tap_dance_tap_hold_t;
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
qk_tap_dance_action_t *action;
|
tap_dance_action_t *action;
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case TD(CT_CLN): // list all tap dance keycodes with tap-hold configurations
|
case TD(CT_CLN): // list all tap dance keycodes with tap-hold configurations
|
||||||
|
@ -182,7 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tap_dance_tap_hold_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void tap_dance_tap_hold_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
||||||
|
|
||||||
if (state->pressed) {
|
if (state->pressed) {
|
||||||
|
@ -200,7 +200,7 @@ void tap_dance_tap_hold_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tap_dance_tap_hold_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void tap_dance_tap_hold_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
||||||
|
|
||||||
if (tap_hold->held) {
|
if (tap_hold->held) {
|
||||||
|
@ -212,7 +212,7 @@ void tap_dance_tap_hold_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
#define ACTION_TAP_DANCE_TAP_HOLD(tap, hold) \
|
#define ACTION_TAP_DANCE_TAP_HOLD(tap, hold) \
|
||||||
{ .fn = {NULL, tap_dance_tap_hold_finished, tap_dance_tap_hold_reset}, .user_data = (void *)&((tap_dance_tap_hold_t){tap, hold, 0}), }
|
{ .fn = {NULL, tap_dance_tap_hold_finished, tap_dance_tap_hold_reset}, .user_data = (void *)&((tap_dance_tap_hold_t){tap, hold, 0}), }
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[CT_CLN] = ACTION_TAP_DANCE_TAP_HOLD(KC_COLN, KC_SCLN),
|
[CT_CLN] = ACTION_TAP_DANCE_TAP_HOLD(KC_COLN, KC_SCLN),
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -256,11 +256,11 @@ enum {
|
||||||
SOME_OTHER_DANCE
|
SOME_OTHER_DANCE
|
||||||
};
|
};
|
||||||
|
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state);
|
td_state_t cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
// For the x tap dance. Put it here so it can be used in any keymap
|
// For the x tap dance. Put it here so it can be used in any keymap
|
||||||
void x_finished(qk_tap_dance_state_t *state, void *user_data);
|
void x_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void x_reset(qk_tap_dance_state_t *state, void *user_data);
|
void x_reset(tap_dance_state_t *state, void *user_data);
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, at the bottom of your `keymap.c` file, you'll need to add the following:
|
Now, at the bottom of your `keymap.c` file, you'll need to add the following:
|
||||||
|
@ -293,7 +293,7 @@ Now, at the bottom of your `keymap.c` file, you'll need to add the following:
|
||||||
* For the third point, there does exist the 'TD_DOUBLE_SINGLE_TAP', however this is not fully tested
|
* For the third point, there does exist the 'TD_DOUBLE_SINGLE_TAP', however this is not fully tested
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
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'.
|
||||||
|
@ -322,7 +322,7 @@ static td_tap_t xtap_state = {
|
||||||
.state = TD_NONE
|
.state = TD_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
void x_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void x_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
xtap_state.state = cur_dance(state);
|
xtap_state.state = cur_dance(state);
|
||||||
switch (xtap_state.state) {
|
switch (xtap_state.state) {
|
||||||
case TD_SINGLE_TAP: register_code(KC_X); break;
|
case TD_SINGLE_TAP: register_code(KC_X); break;
|
||||||
|
@ -337,7 +337,7 @@ void x_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void x_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (xtap_state.state) {
|
switch (xtap_state.state) {
|
||||||
case TD_SINGLE_TAP: unregister_code(KC_X); break;
|
case TD_SINGLE_TAP: unregister_code(KC_X); break;
|
||||||
case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
||||||
|
@ -349,7 +349,7 @@ void x_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
xtap_state.state = TD_NONE;
|
xtap_state.state = TD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[X_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset)
|
[X_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset)
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -385,18 +385,18 @@ static td_state_t td_state;
|
||||||
// Declare your tapdance functions:
|
// Declare your tapdance functions:
|
||||||
|
|
||||||
// Function to determine the current tapdance state
|
// Function to determine the current tapdance state
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state);
|
td_state_t cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
// `finished` and `reset` functions for each tapdance keycode
|
// `finished` and `reset` functions for each tapdance keycode
|
||||||
void altlp_finished(qk_tap_dance_state_t *state, void *user_data);
|
void altlp_finished(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);
|
||||||
```
|
```
|
||||||
|
|
||||||
Below your `LAYOUT`, define each of the tapdance functions:
|
Below your `LAYOUT`, define each of the tapdance functions:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// Determine the tapdance state to return
|
// Determine the tapdance state to return
|
||||||
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;
|
||||||
else return TD_SINGLE_HOLD;
|
else return TD_SINGLE_HOLD;
|
||||||
|
@ -408,7 +408,7 @@ td_state_t cur_dance(qk_tap_dance_state_t *state) {
|
||||||
|
|
||||||
// Handle the possible states for each tapdance keycode you define:
|
// 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);
|
td_state = cur_dance(state);
|
||||||
switch (td_state) {
|
switch (td_state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
|
@ -426,7 +426,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) {
|
switch (td_state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
unregister_code16(KC_LPRN);
|
unregister_code16(KC_LPRN);
|
||||||
|
@ -443,7 +443,7 @@ 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
|
// 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[] = {
|
||||||
[ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset)
|
[ALT_LP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset)
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -478,18 +478,18 @@ enum {
|
||||||
// Declare the functions to be used with your tap dance key(s)
|
// Declare the functions to be used with your tap dance key(s)
|
||||||
|
|
||||||
// Function associated with all tap dances
|
// Function associated with all tap dances
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state);
|
td_state_t cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
// Functions associated with individual tap dances
|
// Functions associated with individual tap dances
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data);
|
void ql_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data);
|
void ql_reset(tap_dance_state_t *state, void *user_data);
|
||||||
```
|
```
|
||||||
|
|
||||||
Towards the bottom of your `keymap.c`, include the following code:
|
Towards the bottom of your `keymap.c`, include the following code:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// 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->pressed) return TD_SINGLE_TAP;
|
if (!state->pressed) return TD_SINGLE_TAP;
|
||||||
else return TD_SINGLE_HOLD;
|
else return TD_SINGLE_HOLD;
|
||||||
|
@ -504,7 +504,7 @@ static td_tap_t ql_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functions that control what our tap dance key does
|
// Functions that control what our tap dance key does
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = cur_dance(state);
|
ql_tap_state.state = cur_dance(state);
|
||||||
switch (ql_tap_state.state) {
|
switch (ql_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
|
@ -528,7 +528,7 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
// If the key was held down and now is released then switch off the layer
|
// If the key was held down and now is released then switch off the layer
|
||||||
if (ql_tap_state.state == TD_SINGLE_HOLD) {
|
if (ql_tap_state.state == TD_SINGLE_HOLD) {
|
||||||
layer_off(_MY_LAYER);
|
layer_off(_MY_LAYER);
|
||||||
|
@ -537,7 +537,7 @@ void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Associate our tap dance key with its functionality
|
// Associate our tap dance key with its functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[QUOT_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset)
|
[QUOT_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ enum {
|
||||||
TD_AB = 0
|
TD_AB = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_AB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_B)
|
[TD_AB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_B)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -155,32 +155,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
|
|
||||||
/* tap dance time */
|
/* tap dance time */
|
||||||
void tdexample1(qk_tap_dance_state_t *state, void *user_data) {
|
void tdexample1(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 2) {
|
if (state->count >= 2) {
|
||||||
SEND_STRING(EXAMPLESTRING1);
|
SEND_STRING(EXAMPLESTRING1);
|
||||||
reset_tap_dance (state);
|
reset_tap_dance (state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void tdexample2(qk_tap_dance_state_t *state, void *user_data) {
|
void tdexample2(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 2) {
|
if (state->count >= 2) {
|
||||||
SEND_STRING(EXAMPLESTRING2);
|
SEND_STRING(EXAMPLESTRING2);
|
||||||
reset_tap_dance (state);
|
reset_tap_dance (state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void tdexample3(qk_tap_dance_state_t *state, void *user_data) {
|
void tdexample3(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 2) {
|
if (state->count >= 2) {
|
||||||
SEND_STRING(EXAMPLESTRING3);
|
SEND_STRING(EXAMPLESTRING3);
|
||||||
reset_tap_dance (state);
|
reset_tap_dance (state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void tdexample4(qk_tap_dance_state_t *state, void *user_data) {
|
void tdexample4(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count >= 2) {
|
if (state->count >= 2) {
|
||||||
SEND_STRING(EXAMPLESTRING4);
|
SEND_STRING(EXAMPLESTRING4);
|
||||||
reset_tap_dance (state);
|
reset_tap_dance (state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1),
|
[TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1),
|
||||||
[TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2),
|
[TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2),
|
||||||
[TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3),
|
[TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3),
|
||||||
|
|
|
@ -203,7 +203,7 @@ void matrix_scan_user(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Tap Dance Definitions
|
//Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
//Tap once for Esc, twice for Caps Lock
|
//Tap once for Esc, twice for Caps Lock
|
||||||
[TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL),
|
[TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL),
|
||||||
[TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI),
|
[TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI),
|
||||||
|
|
|
@ -108,7 +108,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
void tap_dance_choose_layer (qk_tap_dance_state_t *state, void *user_data) {
|
void tap_dance_choose_layer (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
layer_on(_LOWER);
|
layer_on(_LOWER);
|
||||||
|
@ -119,7 +119,7 @@ void tap_dance_choose_layer (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tap_dance_choose_layer_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void tap_dance_choose_layer_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
layer_off(_LOWER);
|
layer_off(_LOWER);
|
||||||
|
@ -138,7 +138,7 @@ void tap_dance_choose_layer_reset (qk_tap_dance_state_t *state, void *user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_SWAP_LAYERS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_choose_layer, tap_dance_choose_layer_reset)
|
[TD_SWAP_LAYERS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_choose_layer, tap_dance_choose_layer_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance definitions
|
// Tap Dance definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for F13 to F18, twice for F19 to F24
|
// Tap once for F13 to F18, twice for F19 to F24
|
||||||
[F13F19] = ACTION_TAP_DANCE_DOUBLE(KC_F13, KC_F19), [F14F20] = ACTION_TAP_DANCE_DOUBLE(KC_F14, KC_F20), [F15F21] = ACTION_TAP_DANCE_DOUBLE(KC_F15, KC_F21),
|
[F13F19] = ACTION_TAP_DANCE_DOUBLE(KC_F13, KC_F19), [F14F20] = ACTION_TAP_DANCE_DOUBLE(KC_F14, KC_F20), [F15F21] = ACTION_TAP_DANCE_DOUBLE(KC_F15, KC_F21),
|
||||||
[F16F22] = ACTION_TAP_DANCE_DOUBLE(KC_F16, KC_F22), [F17F23] = ACTION_TAP_DANCE_DOUBLE(KC_F17, KC_F23), [F18F24] = ACTION_TAP_DANCE_DOUBLE(KC_F18, KC_F24)
|
[F16F22] = ACTION_TAP_DANCE_DOUBLE(KC_F16, KC_F22), [F17F23] = ACTION_TAP_DANCE_DOUBLE(KC_F17, KC_F23), [F18F24] = ACTION_TAP_DANCE_DOUBLE(KC_F18, KC_F24)
|
||||||
|
|
|
@ -45,7 +45,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[] = {
|
||||||
[ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
[ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
||||||
[ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
|
[ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
|
||||||
};
|
};
|
||||||
|
|
|
@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
|
||||||
// Tap Dance Definitions
|
// Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for first parameter, twice for second
|
// Tap once for first parameter, twice for second
|
||||||
[_TD_CTGU] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_LGUI),
|
[_TD_CTGU] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_LGUI),
|
||||||
[_TD_PGUP] = ACTION_TAP_DANCE_DOUBLE(KC_PGUP, LCTL(KC_PGUP)),
|
[_TD_PGUP] = ACTION_TAP_DANCE_DOUBLE(KC_PGUP, LCTL(KC_PGUP)),
|
||||||
|
|
|
@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Definitions
|
// Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for L-Alt, twice for L-GUI
|
// Tap once for L-Alt, twice for L-GUI
|
||||||
[TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI),
|
[TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI),
|
||||||
// Tap once for R-Alt, twice for R-GUI
|
// Tap once for R-Alt, twice for R-GUI
|
||||||
|
|
|
@ -84,7 +84,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
//Tap Dance Definitions
|
//Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
//Tap once for semicolon, twice for ø
|
//Tap once for semicolon, twice for ø
|
||||||
[SCLN_OE] = ACTION_TAP_DANCE_DOUBLE(NO_SCLN, NO_OE),
|
[SCLN_OE] = ACTION_TAP_DANCE_DOUBLE(NO_SCLN, NO_OE),
|
||||||
//Tap once for single quote, twice for æ
|
//Tap once for single quote, twice for æ
|
||||||
|
|
|
@ -101,7 +101,7 @@ enum dances {
|
||||||
TD_DASH_USCR,
|
TD_DASH_USCR,
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Shift, twice for Caps Lock
|
// Tap once for Shift, twice for Caps Lock
|
||||||
[TD_SHFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[TD_SHFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
[TD_COM_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, SE_SCLN),
|
[TD_COM_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, SE_SCLN),
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum tapdances{
|
||||||
TD_ESQW,
|
TD_ESQW,
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
||||||
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,7 +38,7 @@ enum tapdances{
|
||||||
TD_ESQW,
|
TD_ESQW,
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
||||||
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,7 +112,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[] = {
|
||||||
/* Tap once: nothing. Tap twice: Alt+F4 */
|
/* Tap once: nothing. Tap twice: Alt+F4 */
|
||||||
[AF4] = ACTION_TAP_DANCE_DOUBLE(XXXXXXX,A(F4)),
|
[AF4] = ACTION_TAP_DANCE_DOUBLE(XXXXXXX,A(F4)),
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ enum {
|
||||||
TD_SPACE_CADET_ENTER = 1
|
TD_SPACE_CADET_ENTER = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_SPACE_CADET_SHIFT] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_LPRN),
|
[TD_SPACE_CADET_SHIFT] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_LPRN),
|
||||||
[TD_SPACE_CADET_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_ENT, KC_RPRN)
|
[TD_SPACE_CADET_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_ENT, KC_RPRN)
|
||||||
};
|
};
|
||||||
|
|
|
@ -141,7 +141,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parantheses
|
// Parantheses
|
||||||
void paranthesis_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void paranthesis_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
SEND_STRING("()"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
SEND_STRING("()"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -151,7 +151,7 @@ void paranthesis_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void curly_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void curly_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
SEND_STRING("{}"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
SEND_STRING("{}"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -161,7 +161,7 @@ void curly_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void square_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void square_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
SEND_STRING("[]"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
SEND_STRING("[]"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -171,7 +171,7 @@ void square_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void angular_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void angular_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
SEND_STRING("<>"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
SEND_STRING("<>"); register_code(KC_LEFT); unregister_code(KC_LEFT);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -181,7 +181,7 @@ void angular_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tmux_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void tmux_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
SEND_STRING("tmux"); register_code(KC_ENT); unregister_code(KC_ENT);
|
SEND_STRING("tmux"); register_code(KC_ENT); unregister_code(KC_ENT);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -194,7 +194,7 @@ void tmux_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_dance (qk_tap_dance_state_t *state, void *user_data) {
|
void cmd_dance (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_mods(MOD_BIT(KC_LCTL));
|
register_mods(MOD_BIT(KC_LCTL));
|
||||||
register_mods(MOD_BIT(KC_LALT));
|
register_mods(MOD_BIT(KC_LALT));
|
||||||
|
@ -219,7 +219,7 @@ void cmd_dance (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_sft_slash_pipe_down (qk_tap_dance_state_t *state, void *user_data) {
|
void cmd_sft_slash_pipe_down (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->interrupted || state->pressed==0) {
|
if (state->interrupted || state->pressed==0) {
|
||||||
register_code (KC_NONUS_BACKSLASH);
|
register_code (KC_NONUS_BACKSLASH);
|
||||||
|
@ -232,7 +232,7 @@ void cmd_sft_slash_pipe_down (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmd_sft_slash_pipe_up (qk_tap_dance_state_t *state, void *user_data) {
|
void cmd_sft_slash_pipe_up (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (keyboard_report->mods & MOD_BIT(KC_LSFT)) {
|
if (keyboard_report->mods & MOD_BIT(KC_LSFT)) {
|
||||||
unregister_code (KC_LSFT);
|
unregister_code (KC_LSFT);
|
||||||
|
@ -246,7 +246,7 @@ void cmd_sft_slash_pipe_up (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[] = {
|
||||||
[CLN] = ACTION_TAP_DANCE_DOUBLE (KC_SCLN, S(KC_SCLN ))
|
[CLN] = ACTION_TAP_DANCE_DOUBLE (KC_SCLN, S(KC_SCLN ))
|
||||||
,[QUOT] = ACTION_TAP_DANCE_DOUBLE (KC_QUOT, S(KC_2))
|
,[QUOT] = ACTION_TAP_DANCE_DOUBLE (KC_QUOT, S(KC_2))
|
||||||
,[CAD_CAE] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, NULL, cmd_dance )
|
,[CAD_CAE] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, NULL, cmd_dance )
|
||||||
|
|
|
@ -31,7 +31,7 @@ static int espc_r_tap_state = 0;
|
||||||
static int scln_cln_tap_state = 0;
|
static int scln_cln_tap_state = 0;
|
||||||
|
|
||||||
// Watch the state of the tap dance
|
// Watch the state of the tap dance
|
||||||
int cur_dance(qk_tap_dance_state_t *state) {
|
int cur_dance(tap_dance_state_t *state) {
|
||||||
if (state->pressed) {
|
if (state->pressed) {
|
||||||
return SINGLE_HOLD;
|
return SINGLE_HOLD;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ int cur_dance(qk_tap_dance_state_t *state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extended Space Cadet Shift - Left ==================================
|
// Extended Space Cadet Shift - Left ==================================
|
||||||
void espc_l_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void espc_l_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
espc_l_tap_state = cur_dance(state);
|
espc_l_tap_state = cur_dance(state);
|
||||||
switch (espc_l_tap_state) {
|
switch (espc_l_tap_state) {
|
||||||
case SINGLE_TAP: // (
|
case SINGLE_TAP: // (
|
||||||
|
@ -69,7 +69,7 @@ void espc_l_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void espc_l_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void espc_l_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (espc_l_tap_state) {
|
switch (espc_l_tap_state) {
|
||||||
case SINGLE_TAP: // (
|
case SINGLE_TAP: // (
|
||||||
unregister_code16(LSFT(KC_9));
|
unregister_code16(LSFT(KC_9));
|
||||||
|
@ -89,7 +89,7 @@ void espc_l_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
// ====================================================================//
|
// ====================================================================//
|
||||||
|
|
||||||
// Extended Space Cadet Shift - Right ==================================
|
// Extended Space Cadet Shift - Right ==================================
|
||||||
void espc_r_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void espc_r_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
espc_r_tap_state = cur_dance(state);
|
espc_r_tap_state = cur_dance(state);
|
||||||
switch (espc_r_tap_state) {
|
switch (espc_r_tap_state) {
|
||||||
case SINGLE_TAP: // )
|
case SINGLE_TAP: // )
|
||||||
|
@ -109,7 +109,7 @@ void espc_r_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void espc_r_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void espc_r_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (espc_r_tap_state) {
|
switch (espc_r_tap_state) {
|
||||||
case SINGLE_TAP: // )
|
case SINGLE_TAP: // )
|
||||||
unregister_code16(LSFT(KC_0));
|
unregister_code16(LSFT(KC_0));
|
||||||
|
@ -129,7 +129,7 @@ void espc_r_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
// ====================================================================//
|
// ====================================================================//
|
||||||
|
|
||||||
// Semicolon - Colon ==================================================
|
// Semicolon - Colon ==================================================
|
||||||
void scln_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void scln_cln_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
scln_cln_tap_state = cur_dance(state);
|
scln_cln_tap_state = cur_dance(state);
|
||||||
switch (scln_cln_tap_state) {
|
switch (scln_cln_tap_state) {
|
||||||
case SINGLE_TAP: // ;
|
case SINGLE_TAP: // ;
|
||||||
|
@ -141,7 +141,7 @@ void scln_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void scln_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void scln_cln_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (scln_cln_tap_state) {
|
switch (scln_cln_tap_state) {
|
||||||
case SINGLE_TAP: // ;
|
case SINGLE_TAP: // ;
|
||||||
unregister_code16(KC_SCLN);
|
unregister_code16(KC_SCLN);
|
||||||
|
@ -154,7 +154,7 @@ void scln_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
// ====================================================================//
|
// ====================================================================//
|
||||||
|
|
||||||
// Associate tap dance with defined functionality
|
// Associate tap dance with defined functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Extended space cadet shift left: Hold - Shift, One - (, Two - {, Three - [
|
// Extended space cadet shift left: Hold - Shift, One - (, Two - {, Three - [
|
||||||
[ESPC_L] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, espc_l_finished, espc_l_reset),
|
[ESPC_L] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, espc_l_finished, espc_l_reset),
|
||||||
// Extended space cadet shift right: Hold - Shift, One - ), Two - }, Three - ]
|
// Extended space cadet shift right: Hold - Shift, One - ), Two - }, Three - ]
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#include "tap_dances.h"
|
#include "tap_dances.h"
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
|
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
|
||||||
};
|
};
|
||||||
|
|
|
@ -375,7 +375,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_left_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_left_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) { //1 tap, move to line left
|
if (state->count == 1) { //1 tap, move to line left
|
||||||
keymap_config.raw = eeconfig_read_keymap();
|
keymap_config.raw = eeconfig_read_keymap();
|
||||||
if(keymap_config.swap_lctl_lgui){ //Linux
|
if(keymap_config.swap_lctl_lgui){ //Linux
|
||||||
|
@ -388,7 +388,7 @@ void dance_left_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_right_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_right_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) { // 1 tap, move line right
|
if (state->count == 1) { // 1 tap, move line right
|
||||||
keymap_config.raw = eeconfig_read_keymap();
|
keymap_config.raw = eeconfig_read_keymap();
|
||||||
if(keymap_config.swap_lctl_lgui){ //Linux
|
if(keymap_config.swap_lctl_lgui){ //Linux
|
||||||
|
@ -402,7 +402,7 @@ void dance_right_finished (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[] = {
|
||||||
[TD_MOVE_BEGIN_LINE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_left_finished, NULL),
|
[TD_MOVE_BEGIN_LINE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_left_finished, NULL),
|
||||||
[TD_MOVE_END_LINE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_right_finished, NULL),
|
[TD_MOVE_END_LINE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_right_finished, NULL),
|
||||||
[TD_PERIOD_COMMA] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMMA),
|
[TD_PERIOD_COMMA] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMMA),
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
#include "tap_dances.h"
|
#include "tap_dances.h"
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
||||||
[TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
|
[TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
|
||||||
[TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
|
[TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
|
||||||
|
|
|
@ -101,7 +101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//Tap Dance Definitions
|
//Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
|
||||||
//Tap once for space, tap twice for enter
|
//Tap once for space, tap twice for enter
|
||||||
[TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT),
|
[TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT),
|
||||||
|
|
|
@ -35,7 +35,7 @@ enum {
|
||||||
|
|
||||||
int ctl_state = 0;
|
int ctl_state = 0;
|
||||||
|
|
||||||
void ctl_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ctl_state = cur_dance(state);
|
ctl_state = cur_dance(state);
|
||||||
switch (ctl_state) {
|
switch (ctl_state) {
|
||||||
case SINGLE_TAP: leader_start(); break;
|
case SINGLE_TAP: leader_start(); break;
|
||||||
|
@ -47,7 +47,7 @@ void ctl_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctl_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (ctl_state) {
|
switch (ctl_state) {
|
||||||
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
||||||
case DOUBLE_HOLD:
|
case DOUBLE_HOLD:
|
||||||
|
@ -56,7 +56,7 @@ void ctl_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
ctl_state = 0;
|
ctl_state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void g_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void g_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (cur_dance(state)) {
|
switch (cur_dance(state)) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
tap_code16(C(KC_END));
|
tap_code16(C(KC_END));
|
||||||
|
@ -69,7 +69,7 @@ void g_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|
||||||
int kp_state = 0;
|
int kp_state = 0;
|
||||||
|
|
||||||
void kp_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void kp_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
kp_state = hold_cur_dance(state);
|
kp_state = hold_cur_dance(state);
|
||||||
switch (kp_state) {
|
switch (kp_state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
|
@ -81,7 +81,7 @@ void kp_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void kp_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void kp_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (kp_state) {
|
switch (kp_state) {
|
||||||
case SINGLE_HOLD:
|
case SINGLE_HOLD:
|
||||||
case DOUBLE_HOLD:
|
case DOUBLE_HOLD:
|
||||||
|
@ -97,7 +97,7 @@ enum {
|
||||||
TD_KP,
|
TD_KP,
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_LDCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_finished, ctl_reset),
|
[TD_LDCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_finished, ctl_reset),
|
||||||
[TD_G] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, g_finished, NULL),
|
[TD_G] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, g_finished, NULL),
|
||||||
[TD_KP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, kp_finished, kp_reset),
|
[TD_KP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, kp_finished, kp_reset),
|
||||||
|
|
|
@ -29,7 +29,7 @@ enum tapdances{
|
||||||
#define KC_ESLO LT(_LOWER, KC_ESC)
|
#define KC_ESLO LT(_LOWER, KC_ESC)
|
||||||
|
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT),
|
[TD_SCCL] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT),
|
||||||
[TD_ENSL] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ENT),
|
[TD_ENSL] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ENT),
|
||||||
[TD_N0BS] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_BSLS),
|
[TD_N0BS] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_BSLS),
|
||||||
|
|
|
@ -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
|
// 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
|
// 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).
|
// 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;
|
uint16_t keycode;
|
||||||
keyrecord_t record;
|
keyrecord_t record;
|
||||||
dprintf("macro_tap_dance_fn %d\n", state->count);
|
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:
|
// 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.
|
// This Tap dance plays the macro 1 on TAP and records it on double tap.
|
||||||
[TAP_MACRO] = ACTION_TAP_DANCE_FN(macro_tapdance_fn),
|
[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
|
// 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
|
// 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).
|
// 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;
|
uint16_t keycode;
|
||||||
keyrecord_t record;
|
keyrecord_t record;
|
||||||
dprintf("macro_tap_dance_fn %d\n", state->count);
|
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:
|
// 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.
|
// This Tap dance plays the macro 1 on TAP and records it on double tap.
|
||||||
[TAP_MACRO] = ACTION_TAP_DANCE_FN(macro_tapdance_fn)
|
[TAP_MACRO] = ACTION_TAP_DANCE_FN(macro_tapdance_fn)
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap dot_comm_state = {
|
||||||
.state = 0
|
.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);
|
dot_comm_state.state = current_dance(state);
|
||||||
switch (dot_comm_state.state) {
|
switch (dot_comm_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (dot_comm_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_DOT);
|
unregister_code(KC_DOT);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap h_mouse_gui_state = {
|
||||||
.state = 0
|
.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);
|
h_mouse_gui_state.state = current_dance(state);
|
||||||
switch (h_mouse_gui_state.state) {
|
switch (h_mouse_gui_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (h_mouse_gui_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_H);
|
unregister_code(KC_H);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap j_media_meh_state = {
|
||||||
.state = 0
|
.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);
|
j_media_meh_state.state = current_dance(state);
|
||||||
switch (j_media_meh_state.state) {
|
switch (j_media_meh_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (j_media_meh_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_J);
|
unregister_code(KC_J);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap k_numpad_hyper_state = {
|
||||||
.state = 0
|
.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);
|
k_numpad_hyper_state.state = current_dance(state);
|
||||||
switch (k_numpad_hyper_state.state) {
|
switch (k_numpad_hyper_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (k_numpad_hyper_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_K);
|
unregister_code(KC_K);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap m_chords_hyper_state = {
|
||||||
.state = 0
|
.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);
|
m_chords_hyper_state.state = current_dance(state);
|
||||||
switch (m_chords_hyper_state.state) {
|
switch (m_chords_hyper_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (m_chords_hyper_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_M);
|
unregister_code(KC_M);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap none_lead_state = {
|
||||||
.state = 0
|
.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);
|
none_lead_state.state = current_dance(state);
|
||||||
switch (none_lead_state.state) {
|
switch (none_lead_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (none_lead_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_NO);
|
unregister_code(KC_NO);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap quot_dquot_state = {
|
||||||
.state = 0
|
.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);
|
quot_dquot_state.state = current_dance(state);
|
||||||
switch (quot_dquot_state.state) {
|
switch (quot_dquot_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (quot_dquot_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_QUOT);
|
unregister_code(KC_QUOT);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap scln_coln_state = {
|
||||||
.state = 0
|
.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);
|
scln_coln_state.state = current_dance(state);
|
||||||
switch (scln_coln_state.state) {
|
switch (scln_coln_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (scln_coln_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_SCLN);
|
unregister_code(KC_SCLN);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap u_arrows_gui_state = {
|
||||||
.state = 0
|
.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);
|
u_arrows_gui_state.state = current_dance(state);
|
||||||
switch (u_arrows_gui_state.state) {
|
switch (u_arrows_gui_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (u_arrows_gui_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_U);
|
unregister_code(KC_U);
|
||||||
|
|
|
@ -4,7 +4,7 @@ static tap w_media_meh_state = {
|
||||||
.state = 0
|
.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);
|
w_media_meh_state.state = current_dance(state);
|
||||||
switch (w_media_meh_state.state) {
|
switch (w_media_meh_state.state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (w_media_meh_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
unregister_code(KC_W);
|
unregister_code(KC_W);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Register the double tap dances:
|
// 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),
|
[EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS),
|
||||||
[MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),
|
[MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS),
|
||||||
[SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS),
|
[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
|
* 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;
|
int current_state = 0;
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->interrupted || !state->pressed) {
|
if (state->interrupted || !state->pressed) {
|
||||||
|
|
|
@ -53,15 +53,15 @@ static td_state_t td_state;
|
||||||
// declare your tapdance functions:
|
// declare your tapdance functions:
|
||||||
|
|
||||||
// function to determine the current tapdance state
|
// 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
|
// `finished` and `reset` functions for each tapdance keycode
|
||||||
void ctrlto12_finished (qk_tap_dance_state_t *state, void *user_data);
|
void ctrlto12_finished (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);
|
||||||
void altto11_finished (qk_tap_dance_state_t *state, void *user_data);
|
void altto11_finished (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);
|
||||||
void shiftto13_finished (qk_tap_dance_state_t *state, void *user_data);
|
void shiftto13_finished (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);
|
||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
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
|
// 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->count == 1) {
|
||||||
if (state->interrupted && state->pressed && state->interrupting_keycode == KC_MS_BTN1) {return SINGLE_HOLD;}
|
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;}
|
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
|
else { return 2; } // any number higher than the maximum state value you return above
|
||||||
}
|
}
|
||||||
// /* Backup in case previous code is hard to piece together. */
|
// /* 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->count == 1) {
|
||||||
// if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
|
// if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
|
||||||
// else { return SINGLE_HOLD; }
|
// 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
|
// 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);
|
td_state = cur_dance(state);
|
||||||
switch (td_state) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
break;
|
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);
|
td_state = cur_dance(state);
|
||||||
switch (td_state) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
break;
|
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);
|
td_state = cur_dance(state);
|
||||||
switch (td_state) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
break;
|
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
|
// 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),
|
[CTRL_TO12] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctrlto12_finished, ctrlto12_reset),
|
||||||
[SHIFT_TO13] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, shiftto13_finished, shiftto13_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),
|
[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
|
// tap dances
|
||||||
|
|
||||||
// flash keyboard on 4x tap, with leds
|
// 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) {
|
// switch (state->count) {
|
||||||
// case 1:
|
// case 1:
|
||||||
// ergodox_right_led_3_on();
|
// 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) {
|
// if (state->count >= 4) {
|
||||||
// reset_keyboard();
|
// reset_keyboard();
|
||||||
// reset_tap_dance(state);
|
// 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();
|
// ergodox_right_led_1_off();
|
||||||
// wait_ms(50);
|
// wait_ms(50);
|
||||||
// ergodox_right_led_2_off();
|
// 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
|
// 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);
|
// uint8_t layer = get_highest_layer(layer_state);
|
||||||
|
|
||||||
// switch(state->count) {
|
// 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_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 ),
|
// [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ),
|
||||||
// };
|
// };
|
||||||
|
|
|
@ -30,7 +30,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Definition
|
// Tap Dance Definition
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
//Tap once for minus, tap twice for divide
|
//Tap once for minus, tap twice for divide
|
||||||
[TD_M_D] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_PSLS),
|
[TD_M_D] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_PSLS),
|
||||||
//Tap once for plus, tap twice for multiply
|
//Tap once for plus, tap twice for multiply
|
||||||
|
|
|
@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Definitions
|
// Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Q, twice for ESC
|
// Tap once for Q, twice for ESC
|
||||||
[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC)
|
[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC)
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,7 +69,7 @@ void dance_cycle(bool override_timer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_finished(qk_tap_dance_state_t *state, void* user_data) {
|
void dance_finished(tap_dance_state_t *state, void* user_data) {
|
||||||
// Determine the current state
|
// Determine the current state
|
||||||
switch (state->count)
|
switch (state->count)
|
||||||
{
|
{
|
||||||
|
@ -127,12 +127,12 @@ void dance_finished(qk_tap_dance_state_t *state, void* user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_reset(qk_tap_dance_state_t *state, void* user_data)
|
void dance_reset(tap_dance_state_t *state, void* user_data)
|
||||||
{
|
{
|
||||||
tap_dance_active = false;
|
tap_dance_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_KEY] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_finished, dance_reset)
|
[TD_KEY] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_finished, dance_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ enum {
|
||||||
GAME
|
GAME
|
||||||
};
|
};
|
||||||
|
|
||||||
td_state_t cur_dance(qk_tap_dance_state_t *state);
|
td_state_t cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data);
|
void ql_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data);
|
void ql_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
#define KC_CTL_A MT(MOD_LCTL, KC_A) // Tap for A, hold for Control
|
#define KC_CTL_A MT(MOD_LCTL, KC_A) // Tap for A, hold for Control
|
||||||
#define KC_SFT_Z MT(MOD_RSFT, KC_Z) // Tap for Z, hold for Shift
|
#define KC_SFT_Z MT(MOD_RSFT, KC_Z) // Tap for Z, hold for Shift
|
||||||
|
@ -158,7 +158,7 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
return TD_SINGLE_TAP;
|
return TD_SINGLE_TAP;
|
||||||
if (state->count == 2)
|
if (state->count == 2)
|
||||||
|
@ -173,7 +173,7 @@ static td_tap_t ql_tap_state = {
|
||||||
.state = TD_NONE
|
.state = TD_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = cur_dance(state);
|
ql_tap_state.state = cur_dance(state);
|
||||||
switch (ql_tap_state.state) {
|
switch (ql_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
|
@ -194,11 +194,11 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = TD_NONE;
|
ql_tap_state.state = TD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[GAME] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset)
|
[GAME] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ typedef struct {
|
||||||
int state;
|
int state;
|
||||||
} tap;
|
} tap;
|
||||||
|
|
||||||
int cur_dance (qk_tap_dance_state_t *state) {
|
int cur_dance (tap_dance_state_t *state) {
|
||||||
if (state->interrupted == false || state->pressed) {
|
if (state->interrupted == false || state->pressed) {
|
||||||
if (state->count < 2) return SINGLE_HOLD;
|
if (state->count < 2) return SINGLE_HOLD;
|
||||||
if (state->count < 3) return DOUBLE_HOLD;
|
if (state->count < 3) return DOUBLE_HOLD;
|
||||||
|
@ -36,7 +36,7 @@ static tap fn_tap_state = {
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void fn_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void fn_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
fn_tap_state.state = cur_dance(state);
|
fn_tap_state.state = cur_dance(state);
|
||||||
switch (fn_tap_state.state) {
|
switch (fn_tap_state.state) {
|
||||||
/* case SINGLE_HOLD: register_code(MO(_FN)); break; */
|
/* case SINGLE_HOLD: register_code(MO(_FN)); break; */
|
||||||
|
@ -46,7 +46,7 @@ void fn_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fn_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void fn_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (fn_tap_state.state) {
|
switch (fn_tap_state.state) {
|
||||||
case SINGLE_HOLD: layer_off(_FN); break;
|
case SINGLE_HOLD: layer_off(_FN); break;
|
||||||
case DOUBLE_HOLD: layer_off(_MOUSE); layer_off(_MOUSESHIFT); break;
|
case DOUBLE_HOLD: layer_off(_MOUSE); layer_off(_MOUSESHIFT); break;
|
||||||
|
@ -54,7 +54,7 @@ void fn_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[SUPER_FN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, fn_finished, fn_reset)
|
[SUPER_FN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, fn_finished, fn_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ typedef struct {
|
||||||
int state;
|
int state;
|
||||||
} tap;
|
} tap;
|
||||||
|
|
||||||
int cur_dance(qk_tap_dance_state_t *state) {
|
int cur_dance(tap_dance_state_t *state) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
if (state->interrupted || state->pressed == 0) {
|
if (state->interrupted || state->pressed == 0) {
|
||||||
|
@ -87,7 +87,7 @@ static tap N ## _state = { \
|
||||||
.state = 0 \
|
.state = 0 \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
void N ## _finished(qk_tap_dance_state_t *state, void *user_data) { \
|
void N ## _finished(tap_dance_state_t *state, void *user_data) { \
|
||||||
N ## _state.state = cur_dance(state); \
|
N ## _state.state = cur_dance(state); \
|
||||||
switch (N ## _state.state) { \
|
switch (N ## _state.state) { \
|
||||||
case SINGLE_TAP: case SINGLE_HOLD: \
|
case SINGLE_TAP: case SINGLE_HOLD: \
|
||||||
|
@ -100,7 +100,7 @@ void N ## _finished(qk_tap_dance_state_t *state, void *user_data) { \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
void N ## _reset(qk_tap_dance_state_t *state, void *user_data) { \
|
void N ## _reset(tap_dance_state_t *state, void *user_data) { \
|
||||||
switch (N ## _state.state) { \
|
switch (N ## _state.state) { \
|
||||||
case SINGLE_TAP: case SINGLE_HOLD: \
|
case SINGLE_TAP: case SINGLE_HOLD: \
|
||||||
unregister_code(K0); \
|
unregister_code(K0); \
|
||||||
|
@ -134,7 +134,7 @@ my_dance_combo_1(rcg, KC_RCTL, KC_RGUI)
|
||||||
my_dance_combo_3(lsh, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI)
|
my_dance_combo_3(lsh, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI)
|
||||||
my_dance_combo_3(rsh, KC_RSFT, KC_RCTL, KC_RALT, KC_RGUI)
|
my_dance_combo_3(rsh, KC_RSFT, KC_RCTL, KC_RALT, KC_RGUI)
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_LCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lca_finished, lca_reset),
|
[TD_LCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lca_finished, lca_reset),
|
||||||
[TD_RCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rca_finished, rca_reset),
|
[TD_RCTL_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rca_finished, rca_reset),
|
||||||
[TD_LGUI_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lga_finished, lga_reset),
|
[TD_LGUI_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lga_finished, lga_reset),
|
||||||
|
|
|
@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
void dance_media(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_media(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_MPLY);
|
tap_code(KC_MPLY);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -29,7 +29,7 @@ void dance_media(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
|
// Tap once for shift, twice for Caps Lock
|
||||||
[0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
[1] = ACTION_TAP_DANCE_FN(dance_media)};
|
[1] = ACTION_TAP_DANCE_FN(dance_media)};
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -35,7 +35,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);
|
||||||
|
@ -47,7 +47,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),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,48 +49,48 @@ void send_french_unicode_char(uint8_t count, uint32_t once, uint32_t twice)
|
||||||
register_unicode(twice);
|
register_unicode(twice);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_a_q(qk_tap_dance_state_t *state, void *user_data)
|
void dance_a_q(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_A_GRAVE, FR_L_QUOTE);
|
send_french_unicode_char(state->count, FR_A_GRAVE, FR_L_QUOTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_e_q(qk_tap_dance_state_t *state, void *user_data)
|
void dance_e_q(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_E_AIGU, FR_R_QUOTE);
|
send_french_unicode_char(state->count, FR_E_AIGU, FR_R_QUOTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_e_u(qk_tap_dance_state_t *state, void *user_data)
|
void dance_e_u(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_E_GRAVE, FR_U_GRAVE);
|
send_french_unicode_char(state->count, FR_E_GRAVE, FR_U_GRAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_e_e(qk_tap_dance_state_t *state, void *user_data)
|
void dance_e_e(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_E_HAT, FR_E_UMLAUT);
|
send_french_unicode_char(state->count, FR_E_HAT, FR_E_UMLAUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_a_y(qk_tap_dance_state_t *state, void *user_data)
|
void dance_a_y(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_A_HAT, FR_Y_UMLAUT);
|
send_french_unicode_char(state->count, FR_A_HAT, FR_Y_UMLAUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_i_i(qk_tap_dance_state_t *state, void *user_data)
|
void dance_i_i(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_I_HAT, FR_I_UMLAUT);
|
send_french_unicode_char(state->count, FR_I_HAT, FR_I_UMLAUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_o_c(qk_tap_dance_state_t *state, void *user_data)
|
void dance_o_c(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_O_HAT, FR_C_CIRCUM);
|
send_french_unicode_char(state->count, FR_O_HAT, FR_C_CIRCUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_u_u(qk_tap_dance_state_t *state, void *user_data)
|
void dance_u_u(tap_dance_state_t *state, void *user_data)
|
||||||
{
|
{
|
||||||
send_french_unicode_char(state->count, FR_U_HAT, FR_U_UMLAUT);
|
send_french_unicode_char(state->count, FR_U_HAT, FR_U_UMLAUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Define the tap dance actions for the french characters */
|
/* Define the tap dance actions for the french characters */
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[A_Q] = ACTION_TAP_DANCE_FN(dance_a_q),
|
[A_Q] = ACTION_TAP_DANCE_FN(dance_a_q),
|
||||||
[E_Q] = ACTION_TAP_DANCE_FN(dance_e_q),
|
[E_Q] = ACTION_TAP_DANCE_FN(dance_e_q),
|
||||||
[E_U] = ACTION_TAP_DANCE_FN(dance_e_u),
|
[E_U] = ACTION_TAP_DANCE_FN(dance_e_u),
|
||||||
|
|
|
@ -29,7 +29,7 @@ enum taps {
|
||||||
PNX, // Play/pause; next track.
|
PNX, // Play/pause; next track.
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[PNX] = ACTION_TAP_DANCE_DOUBLE(KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK),
|
[PNX] = ACTION_TAP_DANCE_DOUBLE(KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ enum {
|
||||||
TD_ESC_WINDOWS_EMOJI
|
TD_ESC_WINDOWS_EMOJI
|
||||||
};
|
};
|
||||||
|
|
||||||
void td_esc_spotlight_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
void td_esc_spotlight_emoji (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_ESC);
|
tap_code(KC_ESC);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -36,7 +36,7 @@ void td_esc_spotlight_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void td_esc_windows_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
void td_esc_windows_emoji (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_ESC);
|
tap_code(KC_ESC);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -47,7 +47,7 @@ void td_esc_windows_emoji (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[] = {
|
||||||
[TD_ESC_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_spotlight_emoji),
|
[TD_ESC_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_spotlight_emoji),
|
||||||
[TD_ESC_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_windows_emoji)
|
[TD_ESC_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_windows_emoji)
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@ enum {
|
||||||
TD_ESC_WINDOWS_EMOJI
|
TD_ESC_WINDOWS_EMOJI
|
||||||
};
|
};
|
||||||
|
|
||||||
void td_esc_spotlight_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
void td_esc_spotlight_emoji (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_ESC);
|
tap_code(KC_ESC);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -36,7 +36,7 @@ void td_esc_spotlight_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void td_esc_windows_emoji (qk_tap_dance_state_t *state, void *user_data) {
|
void td_esc_windows_emoji (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code(KC_ESC);
|
tap_code(KC_ESC);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -47,7 +47,7 @@ void td_esc_windows_emoji (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[] = {
|
||||||
[TD_ESC_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_spotlight_emoji),
|
[TD_ESC_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_spotlight_emoji),
|
||||||
[TD_ESC_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_windows_emoji)
|
[TD_ESC_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN(td_esc_windows_emoji)
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
//Tap Dance Definitions
|
//Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
//Tap once for Esc, twice for Caps Lock
|
//Tap once for Esc, twice for Caps Lock
|
||||||
[TD_DOT_COMMAS] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMMA)
|
[TD_DOT_COMMAS] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMMA)
|
||||||
// Other declarations would go here, separated by commas, if you have them
|
// Other declarations would go here, separated by commas, if you have them
|
||||||
|
|
|
@ -78,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
#define CHOREOGRAPH(DANCE, PRESS, RELEASE, TAP, DOUBLETAP) \
|
#define CHOREOGRAPH(DANCE, PRESS, RELEASE, TAP, DOUBLETAP) \
|
||||||
static bool dance_ ## DANCE ## _pressed; \
|
static bool dance_ ## DANCE ## _pressed; \
|
||||||
\
|
\
|
||||||
void dance_ ## DANCE ## _finished(qk_tap_dance_state_t *state, void *user_data) { \
|
void dance_ ## DANCE ## _finished(tap_dance_state_t *state, void *user_data) { \
|
||||||
if (state->count == 1) { \
|
if (state->count == 1) { \
|
||||||
if (state->pressed) { \
|
if (state->pressed) { \
|
||||||
dance_ ## DANCE ## _pressed = true; \
|
dance_ ## DANCE ## _pressed = true; \
|
||||||
|
@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
void dance_ ## DANCE ## _reset(qk_tap_dance_state_t *state, void *user_data) { \
|
void dance_ ## DANCE ## _reset(tap_dance_state_t *state, void *user_data) { \
|
||||||
if (state->count == 1) { \
|
if (state->count == 1) { \
|
||||||
if (dance_ ## DANCE ## _pressed) { \
|
if (dance_ ## DANCE ## _pressed) { \
|
||||||
RELEASE; \
|
RELEASE; \
|
||||||
|
@ -138,7 +138,7 @@ CHOREOGRAPH(TD_C_X,
|
||||||
SEND_STRING(SS_UP(X_LCTL)),
|
SEND_STRING(SS_UP(X_LCTL)),
|
||||||
SEND_STRING(SS_DOWN(X_LCTL) SS_TAP(X_X) SS_UP(X_LCTL)),);
|
SEND_STRING(SS_DOWN(X_LCTL) SS_TAP(X_X) SS_UP(X_LCTL)),);
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
STEPS(TD_LEFT), STEPS(TD_RGHT), STEPS(TD_C_X)
|
STEPS(TD_LEFT), STEPS(TD_RGHT), STEPS(TD_C_X)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Functions
|
// Tap Dance Functions
|
||||||
void tri_open(qk_tap_dance_state_t *state, void *user_data) {
|
void tri_open(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code16(KC_LPRN);
|
tap_code16(KC_LPRN);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -22,7 +22,7 @@ void tri_open(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tri_close(qk_tap_dance_state_t *state, void *user_data) {
|
void tri_close(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
tap_code16(KC_RPRN);
|
tap_code16(KC_RPRN);
|
||||||
} else if (state->count == 2) {
|
} else if (state->count == 2) {
|
||||||
|
@ -32,7 +32,7 @@ void tri_close(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dquote(qk_tap_dance_state_t *state, void *user_data) {
|
void dquote(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->interrupted)
|
if (state->interrupted)
|
||||||
tap_code(KC_QUOT);
|
tap_code(KC_QUOT);
|
||||||
|
@ -44,7 +44,7 @@ void dquote(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tilded(qk_tap_dance_state_t *state, void *user_data) {
|
void tilded(tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->interrupted)
|
if (state->interrupted)
|
||||||
tap_code16(KC_TILD);
|
tap_code16(KC_TILD);
|
||||||
|
@ -55,7 +55,7 @@ void tilded(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[OP_QT] = ACTION_TAP_DANCE_FN(tri_open),
|
[OP_QT] = ACTION_TAP_DANCE_FN(tri_open),
|
||||||
[CL_QT] = ACTION_TAP_DANCE_FN(tri_close),
|
[CL_QT] = ACTION_TAP_DANCE_FN(tri_close),
|
||||||
[TD_DQ] = ACTION_TAP_DANCE_FN(dquote),
|
[TD_DQ] = ACTION_TAP_DANCE_FN(dquote),
|
||||||
|
|
|
@ -5,11 +5,11 @@ enum {
|
||||||
TD_BL = 0
|
TD_BL = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
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) {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_cln_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
// single tap - step through backlight
|
// single tap - step through backlight
|
||||||
|
@ -30,7 +30,7 @@ void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_BL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset)
|
[TD_BL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ static void stop_scrolling(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dance_oled_finished(qk_tap_dance_state_t *state, void *user_data) {
|
static void dance_oled_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
if (state->pressed) {
|
if (state->pressed) {
|
||||||
|
@ -155,7 +155,7 @@ static void dance_oled_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {[TD_OLED] = ACTION_TAP_DANCE_FN(dance_oled_finished)};
|
tap_dance_action_t tap_dance_actions[] = {[TD_OLED] = ACTION_TAP_DANCE_FN(dance_oled_finished)};
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT_ortho_1x1(TD(TD_OLED))};
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT_ortho_1x1(TD(TD_OLED))};
|
||||||
|
|
||||||
|
|
|
@ -108,11 +108,11 @@ enum {
|
||||||
// // Alt held down, then use as normal.
|
// // Alt held down, then use as normal.
|
||||||
//
|
//
|
||||||
// Alt tapped, then hold Alt,
|
// Alt tapped, then hold Alt,
|
||||||
int cur_dance (qk_tap_dance_state_t *state);
|
int cur_dance (tap_dance_state_t *state);
|
||||||
void alt_finished (qk_tap_dance_state_t *state, void *user_data);
|
void alt_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void alt_reset (qk_tap_dance_state_t *state, void *user_data);
|
void alt_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
int cur_dance (qk_tap_dance_state_t *state) {
|
int cur_dance (tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->pressed) return SINGLE_HOLD;
|
if (state->pressed) return SINGLE_HOLD;
|
||||||
else return SINGLE_TAP;
|
else return SINGLE_TAP;
|
||||||
|
@ -133,7 +133,7 @@ static tap alttap_state = {
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void alt_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void alt_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
alttap_state.state = cur_dance(state);
|
alttap_state.state = cur_dance(state);
|
||||||
switch (alttap_state.state) {
|
switch (alttap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_layer(_ALT, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break;
|
case SINGLE_TAP: set_oneshot_layer(_ALT, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break;
|
||||||
|
@ -146,7 +146,7 @@ void alt_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void alt_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void alt_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (alttap_state.state) {
|
switch (alttap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LALT); break;
|
case SINGLE_HOLD: unregister_code(KC_LALT); break;
|
||||||
|
@ -157,15 +157,15 @@ void alt_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl tapped, then hold Ctrl,
|
// Ctrl tapped, then hold Ctrl,
|
||||||
void ctl_finished (qk_tap_dance_state_t *state, void *user_data);
|
void ctl_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void ctl_reset (qk_tap_dance_state_t *state, void *user_data);
|
void ctl_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap ctltap_state = {
|
static tap ctltap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void ctl_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
ctltap_state.state = cur_dance(state);
|
ctltap_state.state = cur_dance(state);
|
||||||
switch (ctltap_state.state) {
|
switch (ctltap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LCTL)); break;
|
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LCTL)); break;
|
||||||
|
@ -176,7 +176,7 @@ void ctl_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctl_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (ctltap_state.state) {
|
switch (ctltap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
||||||
|
@ -189,15 +189,15 @@ void ctl_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|
||||||
|
|
||||||
// Layer Down tap dance
|
// Layer Down tap dance
|
||||||
void layerDown_finished (qk_tap_dance_state_t *state, void *user_data);
|
void layerDown_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void layerDown_reset (qk_tap_dance_state_t *state, void *user_data);
|
void layerDown_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap layerdn_tap_state = {
|
static tap layerdn_tap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void layerDown_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void layerDown_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
layerdn_tap_state.state = cur_dance(state);
|
layerdn_tap_state.state = cur_dance(state);
|
||||||
switch (layerdn_tap_state.state) {
|
switch (layerdn_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
|
@ -208,7 +208,7 @@ void layerDown_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void layerDown_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void layerDown_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (layerdn_tap_state.state) {
|
switch (layerdn_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: layer_off(_LOWER); break;
|
case SINGLE_HOLD: layer_off(_LOWER); break;
|
||||||
|
@ -219,15 +219,15 @@ void layerDown_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Layer Up tap dance
|
// Layer Up tap dance
|
||||||
void layerUp_finished (qk_tap_dance_state_t *state, void *user_data);
|
void layerUp_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void layerUp_reset (qk_tap_dance_state_t *state, void *user_data);
|
void layerUp_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap layerup_tap_state = {
|
static tap layerup_tap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void layerUp_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void layerUp_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
layerup_tap_state.state = cur_dance(state);
|
layerup_tap_state.state = cur_dance(state);
|
||||||
switch (layerup_tap_state.state) {
|
switch (layerup_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
|
@ -238,7 +238,7 @@ void layerUp_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void layerUp_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void layerUp_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (layerup_tap_state.state) {
|
switch (layerup_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: layer_off(_RAISE); break;
|
case SINGLE_HOLD: layer_off(_RAISE); break;
|
||||||
|
@ -255,16 +255,16 @@ void layerUp_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
// Shift tapped, then Capitlize next keystroke only.
|
// Shift tapped, then Capitlize next keystroke only.
|
||||||
// Shift double-tapped, then CAPSLOCK
|
// Shift double-tapped, then CAPSLOCK
|
||||||
// Shift double-tapped again, CAPS UNLOCKED
|
// Shift double-tapped again, CAPS UNLOCKED
|
||||||
// void dance_onshot_lsft(qk_tap_dance_state_t *state, void *user_data) {
|
// void dance_onshot_lsft(tap_dance_state_t *state, void *user_data) {
|
||||||
void lshift_finished (qk_tap_dance_state_t *state, void *user_data);
|
void lshift_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void lshift_reset (qk_tap_dance_state_t *state, void *user_data);
|
void lshift_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap lshifttap_state = {
|
static tap lshifttap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void lshift_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void lshift_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
lshifttap_state.state = cur_dance(state);
|
lshifttap_state.state = cur_dance(state);
|
||||||
switch (lshifttap_state.state) {
|
switch (lshifttap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LSFT)); break;
|
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LSFT)); break;
|
||||||
|
@ -274,7 +274,7 @@ void lshift_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lshift_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void lshift_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (lshifttap_state.state) {
|
switch (lshifttap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LSFT); break;
|
case SINGLE_HOLD: unregister_code(KC_LSFT); break;
|
||||||
|
@ -285,15 +285,15 @@ void lshift_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TD_LSPACE
|
//TD_LSPACE
|
||||||
void lspace_finished (qk_tap_dance_state_t *state, void *user_data);
|
void lspace_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void lspace_reset (qk_tap_dance_state_t *state, void *user_data);
|
void lspace_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap lspacetap_state = {
|
static tap lspacetap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void lspace_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void lspace_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
lspacetap_state.state = cur_dance(state);
|
lspacetap_state.state = cur_dance(state);
|
||||||
switch (lspacetap_state.state) {
|
switch (lspacetap_state.state) {
|
||||||
case SINGLE_TAP: tap_code (KC_SPACE); break;
|
case SINGLE_TAP: tap_code (KC_SPACE); break;
|
||||||
|
@ -303,7 +303,7 @@ void lspace_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lspace_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void lspace_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (lspacetap_state.state) {
|
switch (lspacetap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: layer_off(_LOWER); break;
|
case SINGLE_HOLD: layer_off(_LOWER); break;
|
||||||
|
@ -318,7 +318,7 @@ void lspace_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[] = {
|
||||||
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
||||||
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
||||||
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
||||||
|
|
|
@ -63,7 +63,7 @@ enum {
|
||||||
// Shift tapped, then Capitlize next keystroke only.
|
// Shift tapped, then Capitlize next keystroke only.
|
||||||
// Shift double-tapped, then CAPSLOCK
|
// Shift double-tapped, then CAPSLOCK
|
||||||
// Shift double-tapped again, CAPS UNLOCKED
|
// Shift double-tapped again, CAPS UNLOCKED
|
||||||
void dance_onshot_lsft(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_onshot_lsft(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1: // =>
|
case 1: // =>
|
||||||
set_oneshot_mods (MOD_LSFT);
|
set_oneshot_mods (MOD_LSFT);
|
||||||
|
@ -76,7 +76,7 @@ void dance_onshot_lsft(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[] = {
|
||||||
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
||||||
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
||||||
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
||||||
|
|
|
@ -104,11 +104,11 @@ enum {
|
||||||
// // Alt held down, then use as normal.
|
// // Alt held down, then use as normal.
|
||||||
//
|
//
|
||||||
// Alt tapped, then hold Alt,
|
// Alt tapped, then hold Alt,
|
||||||
int cur_dance (qk_tap_dance_state_t *state);
|
int cur_dance (tap_dance_state_t *state);
|
||||||
void alt_finished (qk_tap_dance_state_t *state, void *user_data);
|
void alt_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void alt_reset (qk_tap_dance_state_t *state, void *user_data);
|
void alt_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
int cur_dance (qk_tap_dance_state_t *state) {
|
int cur_dance (tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (state->pressed) return SINGLE_HOLD;
|
if (state->pressed) return SINGLE_HOLD;
|
||||||
else return SINGLE_TAP;
|
else return SINGLE_TAP;
|
||||||
|
@ -129,7 +129,7 @@ static tap alttap_state = {
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void alt_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void alt_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
alttap_state.state = cur_dance(state);
|
alttap_state.state = cur_dance(state);
|
||||||
switch (alttap_state.state) {
|
switch (alttap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_layer(_ALT, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break;
|
case SINGLE_TAP: set_oneshot_layer(_ALT, ONESHOT_START); clear_oneshot_layer_state(ONESHOT_PRESSED); break;
|
||||||
|
@ -142,7 +142,7 @@ void alt_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void alt_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void alt_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (alttap_state.state) {
|
switch (alttap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LALT); break;
|
case SINGLE_HOLD: unregister_code(KC_LALT); break;
|
||||||
|
@ -153,15 +153,15 @@ void alt_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl tapped, then hold Ctrl,
|
// Ctrl tapped, then hold Ctrl,
|
||||||
void ctl_finished (qk_tap_dance_state_t *state, void *user_data);
|
void ctl_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void ctl_reset (qk_tap_dance_state_t *state, void *user_data);
|
void ctl_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap ctltap_state = {
|
static tap ctltap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void ctl_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
ctltap_state.state = cur_dance(state);
|
ctltap_state.state = cur_dance(state);
|
||||||
switch (ctltap_state.state) {
|
switch (ctltap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LCTL)); break;
|
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LCTL)); break;
|
||||||
|
@ -174,7 +174,7 @@ void ctl_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctl_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void ctl_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (ctltap_state.state) {
|
switch (ctltap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
case SINGLE_HOLD: unregister_code(KC_LCTL); break;
|
||||||
|
@ -186,15 +186,15 @@ void ctl_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|
||||||
|
|
||||||
// Layer Down tap dance
|
// Layer Down tap dance
|
||||||
void layerDown_finished (qk_tap_dance_state_t *state, void *user_data);
|
void layerDown_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void layerDown_reset (qk_tap_dance_state_t *state, void *user_data);
|
void layerDown_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap layerdn_tap_state = {
|
static tap layerdn_tap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void layerDown_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void layerDown_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
layerdn_tap_state.state = cur_dance(state);
|
layerdn_tap_state.state = cur_dance(state);
|
||||||
switch (layerdn_tap_state.state) {
|
switch (layerdn_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
|
@ -204,7 +204,7 @@ void layerDown_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void layerDown_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void layerDown_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (layerdn_tap_state.state) {
|
switch (layerdn_tap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: layer_off(_LOWER); break;
|
case SINGLE_HOLD: layer_off(_LOWER); break;
|
||||||
|
@ -222,16 +222,16 @@ void layerDown_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
// Shift tapped, then Capitlize next keystroke only.
|
// Shift tapped, then Capitlize next keystroke only.
|
||||||
// Shift double-tapped, then CAPSLOCK
|
// Shift double-tapped, then CAPSLOCK
|
||||||
// Shift double-tapped again, CAPS UNLOCKED
|
// Shift double-tapped again, CAPS UNLOCKED
|
||||||
// void dance_onshot_lsft(qk_tap_dance_state_t *state, void *user_data) {
|
// void dance_onshot_lsft(tap_dance_state_t *state, void *user_data) {
|
||||||
void lshift_finished (qk_tap_dance_state_t *state, void *user_data);
|
void lshift_finished (tap_dance_state_t *state, void *user_data);
|
||||||
void lshift_reset (qk_tap_dance_state_t *state, void *user_data);
|
void lshift_reset (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
static tap lshifttap_state = {
|
static tap lshifttap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void lshift_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void lshift_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
lshifttap_state.state = cur_dance(state);
|
lshifttap_state.state = cur_dance(state);
|
||||||
switch (lshifttap_state.state) {
|
switch (lshifttap_state.state) {
|
||||||
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LSFT)); break;
|
case SINGLE_TAP: set_oneshot_mods(MOD_BIT(KC_LSFT)); break;
|
||||||
|
@ -241,7 +241,7 @@ void lshift_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lshift_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void lshift_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
switch (lshifttap_state.state) {
|
switch (lshifttap_state.state) {
|
||||||
case SINGLE_TAP: break;
|
case SINGLE_TAP: break;
|
||||||
case SINGLE_HOLD: unregister_code(KC_LSFT); break;
|
case SINGLE_HOLD: unregister_code(KC_LSFT); break;
|
||||||
|
@ -254,7 +254,7 @@ void lshift_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[] = {
|
||||||
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
[TD_DEL_BSPC] = ACTION_TAP_DANCE_DOUBLE(KC_DEL, KC_BSPC),
|
||||||
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
[TD_ESC_GRAVE] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRAVE),
|
||||||
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
[TD_TAB_TILDE] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_TILDE),
|
||||||
|
|
|
@ -35,7 +35,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap dance actions - double tap for Caps Lock.
|
// Tap dance actions - double tap for Caps Lock.
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
|
||||||
[SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ enum keyboard_layers{
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Declarations
|
// Tap Dance Declarations
|
||||||
void td_ctrl (qk_tap_dance_state_t *state, void *user_data);
|
void td_ctrl (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
enum tap_dance { CTRL = 0, BASE = 1 };
|
enum tap_dance { CTRL = 0, BASE = 1 };
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for standard key on base layer, twice to toggle to control layer
|
// Tap once for standard key on base layer, twice to toggle to control layer
|
||||||
[CTRL] = ACTION_TAP_DANCE_FN(td_ctrl),
|
[CTRL] = ACTION_TAP_DANCE_FN(td_ctrl),
|
||||||
[BASE] = ACTION_TAP_DANCE_LAYER_MOVE(_______, _BASE)};
|
[BASE] = ACTION_TAP_DANCE_LAYER_MOVE(_______, _BASE)};
|
||||||
|
@ -105,7 +105,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
// Below works around TD() not running key press through process_record_user.
|
// Below works around TD() not running key press through process_record_user.
|
||||||
// Fixes bug of CTRL layer move key not being wrapped in by modifier on single tap
|
// Fixes bug of CTRL layer move key not being wrapped in by modifier on single tap
|
||||||
void td_ctrl (qk_tap_dance_state_t *state, void *user_data) {
|
void td_ctrl (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code(KC_WRAP);
|
register_code(KC_WRAP);
|
||||||
tap_code(KC_P);
|
tap_code(KC_P);
|
||||||
|
|
|
@ -25,14 +25,14 @@ enum keyboard_layers{
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance stuff
|
// Tap Dance stuff
|
||||||
void td_ctrl (qk_tap_dance_state_t *state, void *user_data);
|
void td_ctrl (tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
enum tap_dance {
|
enum tap_dance {
|
||||||
CTRL = 0,
|
CTRL = 0,
|
||||||
BASE = 1
|
BASE = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for standard key, twice to toggle layers
|
// Tap once for standard key, twice to toggle layers
|
||||||
[CTRL] = ACTION_TAP_DANCE_FN(td_ctrl),
|
[CTRL] = ACTION_TAP_DANCE_FN(td_ctrl),
|
||||||
[BASE] = ACTION_TAP_DANCE_LAYER_MOVE(_______, _BASE)
|
[BASE] = ACTION_TAP_DANCE_LAYER_MOVE(_______, _BASE)
|
||||||
|
@ -110,7 +110,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Below works around TD() not running key press through process_record_user
|
// Below works around TD() not running key press through process_record_user
|
||||||
void td_ctrl (qk_tap_dance_state_t *state, void *user_data) {
|
void td_ctrl (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code(KC_WRAP);
|
register_code(KC_WRAP);
|
||||||
tap_code(KC_D);
|
tap_code(KC_D);
|
||||||
|
|
|
@ -61,7 +61,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance Definitions
|
// Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Left Brace, twice for Right Brace
|
// Tap once for Left Brace, twice for Right Brace
|
||||||
[TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC),
|
[TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC),
|
||||||
//Tap once for Minus, twice for Equal
|
//Tap once for Minus, twice for Equal
|
||||||
|
|
|
@ -43,13 +43,13 @@ enum {
|
||||||
|
|
||||||
// Declare the functions to be used with your tap dance key(s)
|
// Declare the functions to be used with your tap dance key(s)
|
||||||
// Function associated with all tap dances
|
// Function associated with all tap dances
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state);
|
uint8_t cur_dance(tap_dance_state_t *state);
|
||||||
// Functions associated with individual tap dances
|
// Functions associated with individual tap dances
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data);
|
void ql_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data);
|
void ql_reset(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[] = {
|
||||||
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
||||||
};
|
};
|
||||||
|
@ -279,7 +279,7 @@ typedef struct {
|
||||||
} tap;
|
} tap;
|
||||||
|
|
||||||
// Determine the current tap dance state
|
// Determine the current tap dance state
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state) {
|
uint8_t cur_dance(tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (!state->pressed) {
|
if (!state->pressed) {
|
||||||
return SINGLE_TAP;
|
return SINGLE_TAP;
|
||||||
|
@ -310,7 +310,7 @@ static tap ql_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functions that control what our tap dance key does
|
// Functions that control what our tap dance key does
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = cur_dance(state);
|
ql_tap_state.state = cur_dance(state);
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM): // ESC key action
|
case TD(TD_ESC_NUM): // ESC key action
|
||||||
|
@ -340,7 +340,7 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM):
|
case TD(TD_ESC_NUM):
|
||||||
// If the key was held down and now is released then switch off the layer
|
// If the key was held down and now is released then switch off the layer
|
||||||
|
|
|
@ -42,13 +42,13 @@ enum {
|
||||||
|
|
||||||
// Declare the functions to be used with your tap dance key(s)
|
// Declare the functions to be used with your tap dance key(s)
|
||||||
// Function associated with all tap dances
|
// Function associated with all tap dances
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state);
|
uint8_t cur_dance(tap_dance_state_t *state);
|
||||||
// Functions associated with individual tap dances
|
// Functions associated with individual tap dances
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data);
|
void ql_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data);
|
void ql_reset(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[] = {
|
||||||
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
||||||
};
|
};
|
||||||
|
@ -298,7 +298,7 @@ typedef struct {
|
||||||
} tap;
|
} tap;
|
||||||
|
|
||||||
// Determine the current tap dance state
|
// Determine the current tap dance state
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state) {
|
uint8_t cur_dance(tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (!state->pressed) {
|
if (!state->pressed) {
|
||||||
return SINGLE_TAP;
|
return SINGLE_TAP;
|
||||||
|
@ -329,7 +329,7 @@ static tap ql_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functions that control what our tap dance key does
|
// Functions that control what our tap dance key does
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = cur_dance(state);
|
ql_tap_state.state = cur_dance(state);
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM): // ESC key action
|
case TD(TD_ESC_NUM): // ESC key action
|
||||||
|
@ -359,7 +359,7 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM):
|
case TD(TD_ESC_NUM):
|
||||||
// If the key was held down and now is released then switch off the layer
|
// If the key was held down and now is released then switch off the layer
|
||||||
|
|
|
@ -43,13 +43,13 @@ enum {
|
||||||
|
|
||||||
// Declare the functions to be used with your tap dance key(s)
|
// Declare the functions to be used with your tap dance key(s)
|
||||||
// Function associated with all tap dances
|
// Function associated with all tap dances
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state);
|
uint8_t cur_dance(tap_dance_state_t *state);
|
||||||
// Functions associated with individual tap dances
|
// Functions associated with individual tap dances
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data);
|
void ql_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data);
|
void ql_reset(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[] = {
|
||||||
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
[TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset),
|
||||||
};
|
};
|
||||||
|
@ -300,7 +300,7 @@ typedef struct {
|
||||||
} tap;
|
} tap;
|
||||||
|
|
||||||
// Determine the current tap dance state
|
// Determine the current tap dance state
|
||||||
uint8_t cur_dance(qk_tap_dance_state_t *state) {
|
uint8_t cur_dance(tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (!state->pressed) {
|
if (!state->pressed) {
|
||||||
return SINGLE_TAP;
|
return SINGLE_TAP;
|
||||||
|
@ -331,7 +331,7 @@ static tap ql_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functions that control what our tap dance key does
|
// Functions that control what our tap dance key does
|
||||||
void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
ql_tap_state.state = cur_dance(state);
|
ql_tap_state.state = cur_dance(state);
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM): // ESC key action
|
case TD(TD_ESC_NUM): // ESC key action
|
||||||
|
@ -361,7 +361,7 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void ql_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch(TAP_DANCE_KEYCODE(state)) {
|
switch(TAP_DANCE_KEYCODE(state)) {
|
||||||
case TD(TD_ESC_NUM):
|
case TD(TD_ESC_NUM):
|
||||||
// If the key was held down and now is released then switch off the layer
|
// If the key was held down and now is released then switch off the layer
|
||||||
|
|
|
@ -14,7 +14,7 @@ enum tapdance {
|
||||||
TD_END
|
TD_END
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Home, twice for PageUp
|
// Tap once for Home, twice for PageUp
|
||||||
[TD_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_PGUP),
|
[TD_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_PGUP),
|
||||||
// Tap once for End, twice for PageDown
|
// Tap once for End, twice for PageDown
|
||||||
|
|
|
@ -66,7 +66,7 @@ enum {
|
||||||
GUI_NM = 3
|
GUI_NM = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
void dance_CTL_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_CTL_NM_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
set_oneshot_mods(MOD_LCTL);
|
set_oneshot_mods(MOD_LCTL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -75,7 +75,7 @@ void dance_CTL_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_CTL_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_CTL_NM_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
unregister_code (KC_LCTL);
|
unregister_code (KC_LCTL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -84,7 +84,7 @@ void dance_CTL_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_GUI_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_GUI_NM_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code (KC_LGUI);
|
register_code (KC_LGUI);
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,7 +93,7 @@ void dance_GUI_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_GUI_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_GUI_NM_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
unregister_code (KC_LGUI);
|
unregister_code (KC_LGUI);
|
||||||
} else {
|
} else {
|
||||||
|
@ -102,7 +102,7 @@ void dance_GUI_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_ALT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_ALT_NM_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code (KC_LALT);
|
register_code (KC_LALT);
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,7 +111,7 @@ void dance_ALT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_ALT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_ALT_NM_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
unregister_code (KC_LALT);
|
unregister_code (KC_LALT);
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,7 +120,7 @@ void dance_ALT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_SFT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_SFT_NM_finished (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
register_code (KC_LSFT);
|
register_code (KC_LSFT);
|
||||||
set_oneshot_mods(MOD_LSFT);
|
set_oneshot_mods(MOD_LSFT);
|
||||||
|
@ -130,7 +130,7 @@ void dance_SFT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_SFT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void dance_SFT_NM_reset (tap_dance_state_t *state, void *user_data) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
unregister_code (KC_LSFT);
|
unregister_code (KC_LSFT);
|
||||||
} else {
|
} else {
|
||||||
|
@ -140,7 +140,7 @@ void dance_SFT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[CTL_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_CTL_NM_finished, dance_CTL_NM_reset),
|
[CTL_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_CTL_NM_finished, dance_CTL_NM_reset),
|
||||||
[GUI_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_GUI_NM_finished, dance_GUI_NM_reset),
|
[GUI_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_GUI_NM_finished, dance_GUI_NM_reset),
|
||||||
[ALT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_ALT_NM_finished, dance_ALT_NM_reset),
|
[ALT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_ALT_NM_finished, dance_ALT_NM_reset),
|
||||||
|
|
|
@ -44,7 +44,7 @@ enum tapdance {
|
||||||
TD_PGDN
|
TD_PGDN
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for PageUp, twice for Home
|
// Tap once for PageUp, twice for Home
|
||||||
[TD_PGUP] = ACTION_TAP_DANCE_DOUBLE(KC_PGUP, KC_HOME),
|
[TD_PGUP] = ACTION_TAP_DANCE_DOUBLE(KC_PGUP, KC_HOME),
|
||||||
// Tap once for PageDown, twice for End
|
// Tap once for PageDown, twice for End
|
||||||
|
|
|
@ -31,7 +31,7 @@ enum tap_dances {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tap Dance definitions
|
// Tap Dance definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for Escape, twice for Caps Lock
|
// Tap once for Escape, twice for Caps Lock
|
||||||
[LAG] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI),
|
[LAG] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI),
|
||||||
[RAG] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI),
|
[RAG] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI),
|
||||||
|
|
|
@ -51,7 +51,7 @@ void camera_number(uint16_t tens, uint16_t ones) {
|
||||||
tap_code(KC_ENT);
|
tap_code(KC_ENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cam_up(qk_tap_dance_state_t *state, void *user_data) {
|
void cam_up(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
tap_code(KC_C); // tap once for next cam
|
tap_code(KC_C); // tap once for next cam
|
||||||
|
@ -62,7 +62,7 @@ void cam_up(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cam_down(qk_tap_dance_state_t *state, void *user_data) {
|
void cam_down(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (state->count) {
|
switch (state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
tap_code16(LSFT(KC_C)); // tap once for prev cam
|
tap_code16(LSFT(KC_C)); // tap once for prev cam
|
||||||
|
@ -74,7 +74,7 @@ void cam_down(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[] = {
|
||||||
[TD_CAR] = ACTION_TAP_DANCE_DOUBLE(
|
[TD_CAR] = ACTION_TAP_DANCE_DOUBLE(
|
||||||
LSFT(KC_V), // tap once for prev car
|
LSFT(KC_V), // tap once for prev car
|
||||||
LCTL(KC_V) // tap twice for my car
|
LCTL(KC_V) // tap twice for my car
|
||||||
|
|
|
@ -57,7 +57,7 @@ enum bdn9_dances {
|
||||||
TD_DTAP_ADJT
|
TD_DTAP_ADJT
|
||||||
};
|
};
|
||||||
// Tap Dance Definitions
|
// 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_ADIO] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _AUDIO),
|
||||||
[TD_DTAP_LGHT] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _LIGHT),
|
[TD_DTAP_LGHT] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _LIGHT),
|
||||||
[TD_DTAP_ADJT] = ACTION_TAP_DANCE_TRIGGER_LAYER(DOUBLE_TAP, _ADJUST),
|
[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:
|
// declare your tapdance functions:
|
||||||
|
|
||||||
// function to determine the current tapdance state
|
// 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
|
// `finished` and `reset` functions for each tapdance keycode
|
||||||
void altlp_finished (qk_tap_dance_state_t *state, void *user_data);
|
void altlp_finished (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);
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
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
|
// 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
|
// 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->count == 1) {
|
||||||
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
|
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
|
||||||
else { return SINGLE_HOLD; }
|
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:
|
// 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);
|
td_state = cur_dance(state);
|
||||||
switch (td_state) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
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) {
|
switch (td_state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
break;
|
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
|
// 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)
|
[LAY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, altlp_finished, altlp_reset)
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,20 +47,20 @@ enum {
|
||||||
PSLPAS
|
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) {
|
if (state->count == 2) {
|
||||||
layer_on(_ADJUST2);
|
layer_on(_ADJUST2);
|
||||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
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) {
|
if (state->count == 2) {
|
||||||
layer_off(_ADJUST2);
|
layer_off(_ADJUST2);
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
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
|
[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
|
[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
|
[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
|
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) {
|
if (state->count == 2) {
|
||||||
layer_on(_ADJUST2);
|
layer_on(_ADJUST2);
|
||||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
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) {
|
if (state->count == 2) {
|
||||||
layer_off(_ADJUST2);
|
layer_off(_ADJUST2);
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
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
|
[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
|
[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
|
[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,
|
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
|
[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,
|
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),
|
[_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).
|
// 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) {
|
if (state->count == 1) {
|
||||||
register_code (KC_LSFT);
|
register_code (KC_LSFT);
|
||||||
} else if (state->count == 2) {
|
} 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);
|
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) {
|
if (state->count == 1) {
|
||||||
unregister_code (KC_LSFT);
|
unregister_code (KC_LSFT);
|
||||||
} else {
|
} 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
|
//Tap once for Shift, twice for Caps Lock
|
||||||
[SFT_LCK] = ACTION_TAP_DANCE_FN_ADVANCED( caps_tap, NULL, caps_tap_end)
|
[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)
|
[SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ enum {
|
||||||
TD_SCL = 0
|
TD_SCL = 0
|
||||||
};
|
};
|
||||||
//Tap Dance Definitions
|
//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
|
//Tap once for Shift, twice for Caps Lock
|
||||||
[TD_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
[TD_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,7 @@ enum custom_keycodes {
|
||||||
enum {
|
enum {
|
||||||
TD_S
|
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),
|
[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.
|
* 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. */
|
/* Tap once for 5, twice for Enter. */
|
||||||
[_TD_FIVE_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
[_TD_FIVE_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,20 +43,20 @@ enum {
|
||||||
PSLPAS
|
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) {
|
if (state->count == 2) {
|
||||||
layer_on(_ADJUST2);
|
layer_on(_ADJUST2);
|
||||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
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) {
|
if (state->count == 2) {
|
||||||
layer_off(_ADJUST2);
|
layer_off(_ADJUST2);
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
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
|
[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
|
[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
|
[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
|
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) {
|
if (state->count == 2) {
|
||||||
layer_on(_ADJUST2);
|
layer_on(_ADJUST2);
|
||||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
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) {
|
if (state->count == 2) {
|
||||||
layer_off(_ADJUST2);
|
layer_off(_ADJUST2);
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
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
|
[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
|
[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
|
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||||
|
|
|
@ -92,7 +92,7 @@ bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_hex(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_hex(tap_dance_state_t *state, void *user_data) {
|
||||||
switch(state->count) {
|
switch(state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
SEND_STRING("0x");
|
SEND_STRING("0x");
|
||||||
|
@ -103,7 +103,7 @@ void dance_hex(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dance_lang(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_lang(tap_dance_state_t *state, void *user_data) {
|
||||||
uint32_t default_layer;
|
uint32_t default_layer;
|
||||||
switch(state->count) {
|
switch(state->count) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -121,7 +121,7 @@ void dance_lang(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TdH] = ACTION_TAP_DANCE_FN(dance_hex),
|
[TdH] = ACTION_TAP_DANCE_FN(dance_hex),
|
||||||
[TdL] = ACTION_TAP_DANCE_FN(dance_lang)
|
[TdL] = ACTION_TAP_DANCE_FN(dance_lang)
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
static td_tap_t mac_caps_language_tap_state = {.is_press_action = true, .state = TD_NONE};
|
static td_tap_t mac_caps_language_tap_state = {.is_press_action = true, .state = TD_NONE};
|
||||||
|
|
||||||
void mac_caps_language_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void mac_caps_language_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
mac_caps_language_tap_state.state = current_dance(state);
|
mac_caps_language_tap_state.state = current_dance(state);
|
||||||
switch (mac_caps_language_tap_state.state) {
|
switch (mac_caps_language_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
|
@ -34,7 +34,7 @@ void mac_caps_language_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mac_caps_language_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void mac_caps_language_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (mac_caps_language_tap_state.state) {
|
switch (mac_caps_language_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
unregister_code(KC_SPACE);
|
unregister_code(KC_SPACE);
|
||||||
|
|
|
@ -19,5 +19,5 @@
|
||||||
|
|
||||||
#include "tap_dance_setup.h"
|
#include "tap_dance_setup.h"
|
||||||
|
|
||||||
void mac_caps_language_finished(qk_tap_dance_state_t *state, void *user_data);
|
void mac_caps_language_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void mac_caps_language_reset(qk_tap_dance_state_t *state, void *user_data);
|
void mac_caps_language_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
#include "tap_dance_setup.h"
|
#include "tap_dance_setup.h"
|
||||||
|
|
||||||
td_state_t current_dance(qk_tap_dance_state_t *state) {
|
td_state_t current_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 w ant to send a 'HOLD'. */
|
/* Key has not been interrupted, but the key is still held. Means you w ant to send a 'HOLD'. */
|
||||||
|
|
|
@ -35,4 +35,4 @@ typedef struct {
|
||||||
td_state_t state;
|
td_state_t state;
|
||||||
} td_tap_t;
|
} td_tap_t;
|
||||||
|
|
||||||
td_state_t current_dance(qk_tap_dance_state_t *state);
|
td_state_t current_dance(tap_dance_state_t *state);
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[MAC_CAPS_LANGUAGE_CHANGE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, mac_caps_language_finished, mac_caps_language_reset),
|
[MAC_CAPS_LANGUAGE_CHANGE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, mac_caps_language_finished, mac_caps_language_reset),
|
||||||
[WIN_CAPS_LANGUAGE_CHANGE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, win_caps_language_finished, win_caps_language_reset)
|
[WIN_CAPS_LANGUAGE_CHANGE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, win_caps_language_finished, win_caps_language_reset)
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
static td_tap_t win_caps_language_tap_state = {.is_press_action = true, .state = TD_NONE};
|
static td_tap_t win_caps_language_tap_state = {.is_press_action = true, .state = TD_NONE};
|
||||||
|
|
||||||
void win_caps_language_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void win_caps_language_finished(tap_dance_state_t *state, void *user_data) {
|
||||||
win_caps_language_tap_state.state = current_dance(state);
|
win_caps_language_tap_state.state = current_dance(state);
|
||||||
switch (win_caps_language_tap_state.state) {
|
switch (win_caps_language_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
|
@ -34,7 +34,7 @@ void win_caps_language_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_caps_language_reset(qk_tap_dance_state_t *state, void *user_data) {
|
void win_caps_language_reset(tap_dance_state_t *state, void *user_data) {
|
||||||
switch (win_caps_language_tap_state.state) {
|
switch (win_caps_language_tap_state.state) {
|
||||||
case TD_SINGLE_TAP:
|
case TD_SINGLE_TAP:
|
||||||
unregister_code(KC_SPACE);
|
unregister_code(KC_SPACE);
|
||||||
|
|
|
@ -19,5 +19,5 @@
|
||||||
|
|
||||||
#include "tap_dance_setup.h"
|
#include "tap_dance_setup.h"
|
||||||
|
|
||||||
void win_caps_language_finished(qk_tap_dance_state_t *state, void *user_data);
|
void win_caps_language_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void win_caps_language_reset(qk_tap_dance_state_t *state, void *user_data);
|
void win_caps_language_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
|
@ -33,11 +33,11 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
//function to handle all the tap dances
|
//function to handle all the tap dances
|
||||||
int cur_dance(qk_tap_dance_state_t *state);
|
int cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
//functions for each tap dance
|
//functions for each tap dance
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data);
|
void tk_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data);
|
void tk_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
#define INDICATOR_LED B5
|
#define INDICATOR_LED B5
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//determine the current tap dance state
|
//determine the current tap dance state
|
||||||
int cur_dance (qk_tap_dance_state_t *state){
|
int cur_dance (tap_dance_state_t *state){
|
||||||
if(state->count == 1){
|
if(state->count == 1){
|
||||||
//if a tap was registered
|
//if a tap was registered
|
||||||
if(!state->pressed){
|
if(!state->pressed){
|
||||||
|
@ -88,7 +88,7 @@ static tap tk_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//functions that control what our tap dance key does
|
//functions that control what our tap dance key does
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
void tk_finished(tap_dance_state_t *state, void *user_data){
|
||||||
tk_tap_state.state = cur_dance(state);
|
tk_tap_state.state = cur_dance(state);
|
||||||
switch(tk_tap_state.state){
|
switch(tk_tap_state.state){
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
|
@ -116,7 +116,7 @@ void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
void tk_reset(tap_dance_state_t *state, void *user_data){
|
||||||
//if held and released, leave the layer
|
//if held and released, leave the layer
|
||||||
if(tk_tap_state.state == SINGLE_HOLD){
|
if(tk_tap_state.state == SINGLE_HOLD){
|
||||||
layer_off(_FN0);
|
layer_off(_FN0);
|
||||||
|
@ -126,6 +126,6 @@ void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
||||||
}
|
}
|
||||||
|
|
||||||
//associate the tap dance key with its functionality
|
//associate the tap dance key with its functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,11 +67,11 @@ enum custom_keycodes { // git macros
|
||||||
};
|
};
|
||||||
|
|
||||||
//function to handle all the tap dances
|
//function to handle all the tap dances
|
||||||
int cur_dance(qk_tap_dance_state_t *state);
|
int cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
//functions for each tap dance
|
//functions for each tap dance
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data);
|
void tk_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data);
|
void tk_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
// define the macros in here
|
// define the macros in here
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
@ -167,7 +167,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//determine the current tap dance state
|
//determine the current tap dance state
|
||||||
int cur_dance (qk_tap_dance_state_t *state){
|
int cur_dance (tap_dance_state_t *state){
|
||||||
if(state->count == 1)
|
if(state->count == 1)
|
||||||
{
|
{
|
||||||
//if a tap was registered
|
//if a tap was registered
|
||||||
|
@ -203,7 +203,7 @@ static tap tk_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//functions that control what our tap dance key does
|
//functions that control what our tap dance key does
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
void tk_finished(tap_dance_state_t *state, void *user_data){
|
||||||
tk_tap_state.state = cur_dance(state);
|
tk_tap_state.state = cur_dance(state);
|
||||||
uint8_t val = rgblight_get_val();
|
uint8_t val = rgblight_get_val();
|
||||||
switch(tk_tap_state.state){
|
switch(tk_tap_state.state){
|
||||||
|
@ -246,7 +246,7 @@ void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
void tk_reset(tap_dance_state_t *state, void *user_data){
|
||||||
//if held and released, leave the layer
|
//if held and released, leave the layer
|
||||||
if(tk_tap_state.state == SINGLE_HOLD){
|
if(tk_tap_state.state == SINGLE_HOLD){
|
||||||
layer_off(_GI4);
|
layer_off(_GI4);
|
||||||
|
@ -258,6 +258,6 @@ void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
||||||
}
|
}
|
||||||
|
|
||||||
//associate the tap dance key with its functionality
|
//associate the tap dance key with its functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,11 +34,11 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
//function to handle all the tap dances
|
//function to handle all the tap dances
|
||||||
int cur_dance(qk_tap_dance_state_t *state);
|
int cur_dance(tap_dance_state_t *state);
|
||||||
|
|
||||||
//functions for each tap dance
|
//functions for each tap dance
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data);
|
void tk_finished(tap_dance_state_t *state, void *user_data);
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data);
|
void tk_reset(tap_dance_state_t *state, void *user_data);
|
||||||
|
|
||||||
#define INDICATOR_LED B5
|
#define INDICATOR_LED B5
|
||||||
#define TX_LED D5
|
#define TX_LED D5
|
||||||
|
@ -85,7 +85,7 @@ void matrix_init_user(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//determine the current tap dance state
|
//determine the current tap dance state
|
||||||
int cur_dance (qk_tap_dance_state_t *state){
|
int cur_dance (tap_dance_state_t *state){
|
||||||
if(state->count == 1){
|
if(state->count == 1){
|
||||||
//if a tap was registered
|
//if a tap was registered
|
||||||
if(!state->pressed){
|
if(!state->pressed){
|
||||||
|
@ -114,7 +114,7 @@ static tap tk_tap_state = {
|
||||||
};
|
};
|
||||||
|
|
||||||
//functions that control what our tap dance key does
|
//functions that control what our tap dance key does
|
||||||
void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
void tk_finished(tap_dance_state_t *state, void *user_data){
|
||||||
tk_tap_state.state = cur_dance(state);
|
tk_tap_state.state = cur_dance(state);
|
||||||
switch(tk_tap_state.state){
|
switch(tk_tap_state.state){
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
|
@ -166,7 +166,7 @@ void tk_finished(qk_tap_dance_state_t *state, void *user_data){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
void tk_reset(tap_dance_state_t *state, void *user_data){
|
||||||
//if held and released, leave the layer
|
//if held and released, leave the layer
|
||||||
if(tk_tap_state.state == SINGLE_HOLD){
|
if(tk_tap_state.state == SINGLE_HOLD){
|
||||||
layer_off(_FN0);
|
layer_off(_FN0);
|
||||||
|
@ -177,6 +177,6 @@ void tk_reset(qk_tap_dance_state_t *state, void *user_data){
|
||||||
|
|
||||||
|
|
||||||
//associate the tap dance key with its functionality
|
//associate the tap dance key with its functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
[TAPPY_KEY] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tk_finished, tk_reset)
|
||||||
};
|
};
|
||||||
|
|
|
@ -89,6 +89,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_PLAY_DO_NOT_DISTURB] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_F6)
|
[TD_PLAY_DO_NOT_DISTURB] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_F6)
|
||||||
};
|
};
|
|
@ -30,7 +30,7 @@ enum tapdance {
|
||||||
TD_APP_CAPS_LOCK,
|
TD_APP_CAPS_LOCK,
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_SINGLE_QUOTE_DOUBLE_QUOTES] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_DQUO),
|
[TD_SINGLE_QUOTE_DOUBLE_QUOTES] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_DQUO),
|
||||||
[TD_APP_CAPS_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_APP, KC_CAPS),
|
[TD_APP_CAPS_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_APP, KC_CAPS),
|
||||||
};
|
};
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue