aboutsummaryrefslogtreecommitdiff
path: root/qmk/keyboards/sofle_choc/keymaps/custom/quad_tapdance.h
blob: 92ce430cdd4a803eb2f8787954eae3a939532ed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "keymap_bepo.h"
#include "keycodes.h"

typedef enum {
    TD_NONE,
    TD_UNKNOWN,
    TD_SINGLE_TAP,
    TD_SINGLE_HOLD,
    TD_DOUBLE_TAP,
    TD_DOUBLE_HOLD,
    TD_DOUBLE_SINGLE_TAP, // Send two single taps
    TD_TRIPLE_TAP,
    TD_TRIPLE_HOLD
} td_state_t;

typedef struct {
    bool is_press_action;
    td_state_t state;
} td_tap_t;

td_state_t cur_dance(tap_dance_state_t *state);

// For the x tap dance. Put it here so it can be used in any keymap
void w_finished(tap_dance_state_t *state, void *user_data);
void w_reset(tap_dance_state_t *state, void *user_data);

void ql_finished(tap_dance_state_t *state, void *user_data);
void ql_reset(tap_dance_state_t *state, void *user_data);

void lshift_finished(tap_dance_state_t *state, void *user_data);
void lshift_reset(tap_dance_state_t *state, void *user_data);