Update タップダンスの状態判別を、Single,Double,Triple,Holdの4つのステータスにまとめた。

This commit is contained in:
Takeshi Nishio 2020-08-26 06:14:56 +09:00
parent 4793baa630
commit 6ec87c5d26

View File

@ -61,8 +61,9 @@ enum tap_dances{
// for toggle layer by ESC // for toggle layer by ESC
enum { enum {
SINGLE_TAP = 1, SINGLE_TAP = 1,
SINGLE_HOLD, DOUBLE_TAP,
TRIPLE_TAP TRIPLE_TAP,
TAP_HOLD,
}; };
// Declare the functions to be used with your tap dance key(s) // Declare the functions to be used with your tap dance key(s)
@ -426,9 +427,12 @@ typedef struct {
// Determine the current tap dance state // Determine the current tap dance state
uint8_t cur_dance(qk_tap_dance_state_t *state) { uint8_t cur_dance(qk_tap_dance_state_t *state) {
if (state->count < 3) { if (state->count == 1) {
if (!state->pressed) return SINGLE_TAP; if (!state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD; else return TAP_HOLD;
} else if (state->count == 2) {
if (!state->pressed) return DOUBLE_TAP;
else return TAP_HOLD;
} else if (state->count == 3) return TRIPLE_TAP; } else if (state->count == 3) return TRIPLE_TAP;
else return 8; else return 8;
} }