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

26 lines
588 B
C

#include "keymap.h"
#include "tapdance.h"
uint8_t dance_step(qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) {
return SINGLE_TAP;
} else {
return SINGLE_HOLD;
}
} else if (state->count == 2) {
if (state->interrupted) {
return DOUBLE_SINGLE_TAP;
} else if (state->pressed) {
return DOUBLE_HOLD;
} else {
return DOUBLE_TAP;
}
}
return MORE_TAPS;
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_WMLAYOUT] = ACTION_TAP_DANCE_FN_ADVANCED(td_wmlayout_dance, td_wmlayout_finished, td_wmlayout_reset),
};