Created
January 8, 2020 16:29
-
-
Save mcansky/c6d5f19abd0df421b1e0d54c46409289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- ---- ---- ---- ---- | |
//Functions associated with shift - ctrl tap dance | |
void shift_ctrl_toggle (qk_tap_dance_state_t *state, void *user_data); | |
void shift_ctrl_reset (qk_tap_dance_state_t *state, void *user_data); | |
//Initialize tap structure associated with example tap dance key | |
static tap lsft_tap_state = { | |
.is_press_action = true, | |
.state = 0 | |
}; | |
//single tap, single hold, double tap, double tap hold | |
//_ , Shift, , _ , Ctrl | |
void shift_ctrl_toggle (qk_tap_dance_state_t *state, void *user_data) { | |
lsft_tap_state.state = cur_dance(state); | |
switch (lsft_tap_state.state) { | |
case SINGLE_TAP: | |
register_code(KC_LSFT); | |
break; | |
case SINGLE_HOLD: | |
register_code(KC_LSFT); | |
break; | |
case DOUBLE_TAP: | |
register_code(KC_LSFT); | |
break; | |
case DOUBLE_HOLD: | |
register_code(KC_LCTL); | |
break; | |
} | |
} | |
void shift_ctrl_reset (qk_tap_dance_state_t *state, void *user_data) { | |
// if key is held down it should work fine as LSFT | |
if (lsft_tap_state.state==SINGLE_HOLD) { | |
tap_code(KC_LSFT); | |
} | |
if (lsft_tap_state.state==SINGLE_TAP) { | |
tap_code(KC_LSFT); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment