QMK/keymaps/default/tapdance/tapdance.c

22 lines
431 B
C
Raw Normal View History

2022-02-06 19:47:50 -08:00
#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;
}