aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_tap_dance.h
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.h')
-rw-r--r--quantum/process_keycode/process_tap_dance.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index b9d7c7fcf..bf925df0f 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -22,6 +22,7 @@ typedef enum
22} qk_tap_dance_type_t; 22} qk_tap_dance_type_t;
23 23
24typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); 24typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state);
25typedef void (*qk_tap_dance_user_fn_reset_t) (void);
25 26
26typedef struct 27typedef struct
27{ 28{
@@ -31,18 +32,37 @@ typedef struct
31 uint16_t kc1; 32 uint16_t kc1;
32 uint16_t kc2; 33 uint16_t kc2;
33 } pair; 34 } pair;
34 qk_tap_dance_user_fn_t fn; 35 struct {
36 qk_tap_dance_user_fn_t regular;
37 qk_tap_dance_user_fn_t anyway;
38 qk_tap_dance_user_fn_reset_t reset;
39 } fn;
35 }; 40 };
36} qk_tap_dance_action_t; 41} qk_tap_dance_action_t;
37 42
38#define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ 43#define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \
39 .type = QK_TAP_DANCE_TYPE_PAIR, \ 44 .type = QK_TAP_DANCE_TYPE_PAIR, \
40 .pair = { kc1, kc2 } \ 45 .pair = { kc1, kc2 } \
41 } 46 }
42 47
43#define ACTION_TAP_DANCE_FN(user_fn) { \ 48#define ACTION_TAP_DANCE_FN(user_fn) { \
44 .type = QK_TAP_DANCE_TYPE_FN, \ 49 .type = QK_TAP_DANCE_TYPE_FN, \
45 .fn = user_fn \ 50 .fn = { user_fn, NULL, NULL } \
51 }
52
53#define ACTION_TAP_DANCE_FN_ANYWAY(user_fn, user_fn_anyway) { \
54 .type = QK_TAP_DANCE_TYPE_FN, \
55 .fn = { user_fn, user_fn_anyway, NULL } \
56 }
57
58#define ACTION_TAP_DANCE_FN_RESET(user_fn, user_fn_reset) { \
59 .type = QK_TAP_DANCE_TYPE_FN, \
60 .fn = { user_fn, NULL, user_fn_reset } \
61 }
62
63#define ACTION_TAP_DANCE_FN_ANYWAY_RESET(user_fn, user_fn_anyway, user_fn_reset) { \
64 .type = QK_TAP_DANCE_TYPE_FN, \
65 .fn = { user_fn, user_fn_anyway, user_fn_reset } \
46 } 66 }
47 67
48extern const qk_tap_dance_action_t tap_dance_actions[]; 68extern const qk_tap_dance_action_t tap_dance_actions[];