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

43 lines
987 B
C

#include "keymap.h"
#include "tapdance.h"
void td_screenshot(qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
tap_code16(KC_PSCREEN);
} else if (state->count == 2) {
tap_code16(LSFT(KC_PSCREEN));
} else if (state->count == 3) {
tap_code16(LALT(KC_PSCREEN));
} else {
reset_tap_dance(state);
}
}
void td_ocr(qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
tap_code16(LCTL(KC_PSCREEN));
} else if (state->count == 2) {
tap_code16(LCTL(LSFT(KC_PSCREEN)));
} else {
reset_tap_dance(state);
}
}
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[] = {
[TD_WMLAYOUT] = ACTION_TAP_DANCE_FN(td_wmlayout),
[TD_SCREENSHOT] = ACTION_TAP_DANCE_FN(td_screenshot),
[TD_OCR] = ACTION_TAP_DANCE_FN(td_ocr),
};