QMK/keyboards/betalupi_ergodox/keymaps/default/parts/tapdance.c

37 lines
926 B
C
Raw Normal View History

2022-08-03 07:41:21 -07:00
void td_screenshot(qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
2022-12-27 13:22:07 -08:00
tap_code16(KC_PSCR);
2022-08-03 07:41:21 -07:00
} else if (state->count == 2) {
2022-12-27 13:22:07 -08:00
tap_code16(LSFT(KC_PSCR));
2022-08-03 07:41:21 -07:00
} else if (state->count == 3) {
2022-12-27 13:22:07 -08:00
tap_code16(LALT(KC_PSCR));
2022-08-03 07:41:21 -07:00
} else {
reset_tap_dance(state);
}
}
2022-08-03 07:41:21 -07:00
void td_ocr(qk_tap_dance_state_t *state, void *user_data) {
2022-02-06 19:47:50 -08:00
if (state->count == 1) {
2022-12-27 13:22:07 -08:00
tap_code16(LCTL(KC_PSCR));
2022-02-06 19:47:50 -08:00
} else if (state->count == 2) {
2022-12-27 13:22:07 -08:00
tap_code16(LCTL(LSFT(KC_PSCR)));
2022-08-03 07:41:21 -07:00
} else {
reset_tap_dance(state);
2022-02-06 19:47:50 -08:00
}
}
2022-08-03 07:41:21 -07:00
void td_wmlayout(qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
tap_code16(LGUI(KC_COMMA));
} else if (state->count == 2) {
tap_code16(LGUI(KC_DOT));
} else {
reset_tap_dance(state);
}
}
qk_tap_dance_action_t tap_dance_actions[] = {
2022-08-03 07:41:21 -07:00
[TD_WMLAYOUT] = ACTION_TAP_DANCE_FN(td_wmlayout),
[TD_SCREENSHOT] = ACTION_TAP_DANCE_FN(td_screenshot),
[TD_OCR] = ACTION_TAP_DANCE_FN(td_ocr),
2022-12-27 13:22:07 -08:00
};