diff options
author | Pavlos Vinieratos <pvinis@gmail.com> | 2016-07-15 23:54:08 +0200 |
---|---|---|
committer | Pavlos Vinieratos <pvinis@gmail.com> | 2016-07-17 08:28:03 +0200 |
commit | d3091faf363afc8fef73ddf4948f872439b0e827 (patch) | |
tree | 8741f3b0cf7ab54e3943598eafcef052faab30be /quantum/process_keycode/process_tap_dance.h | |
parent | f3b56701ed7e6c622dc48e429780124ba5fde172 (diff) | |
download | qmk_firmware-d3091faf363afc8fef73ddf4948f872439b0e827.tar.gz qmk_firmware-d3091faf363afc8fef73ddf4948f872439b0e827.zip |
change naming, and remove extraneous definition
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.h')
-rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index bf925df0f..7b820584a 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h | |||
@@ -22,7 +22,6 @@ typedef enum | |||
22 | } qk_tap_dance_type_t; | 22 | } qk_tap_dance_type_t; |
23 | 23 | ||
24 | typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); | 24 | typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); |
25 | typedef void (*qk_tap_dance_user_fn_reset_t) (void); | ||
26 | 25 | ||
27 | typedef struct | 26 | typedef struct |
28 | { | 27 | { |
@@ -33,9 +32,9 @@ typedef struct | |||
33 | uint16_t kc2; | 32 | uint16_t kc2; |
34 | } pair; | 33 | } pair; |
35 | struct { | 34 | struct { |
36 | qk_tap_dance_user_fn_t regular; | 35 | qk_tap_dance_user_fn_t on_each_tap; |
37 | qk_tap_dance_user_fn_t anyway; | 36 | qk_tap_dance_user_fn_t on_dance_finished; |
38 | qk_tap_dance_user_fn_reset_t reset; | 37 | qk_tap_dance_user_fn_t on_reset; |
39 | } fn; | 38 | } fn; |
40 | }; | 39 | }; |
41 | } qk_tap_dance_action_t; | 40 | } qk_tap_dance_action_t; |
@@ -45,24 +44,14 @@ typedef struct | |||
45 | .pair = { kc1, kc2 } \ | 44 | .pair = { kc1, kc2 } \ |
46 | } | 45 | } |
47 | 46 | ||
48 | #define ACTION_TAP_DANCE_FN(user_fn) { \ | 47 | #define ACTION_TAP_DANCE_FN(user_fn) { \ |
49 | .type = QK_TAP_DANCE_TYPE_FN, \ | 48 | .type = QK_TAP_DANCE_TYPE_FN, \ |
50 | .fn = { user_fn, NULL, NULL } \ | 49 | .fn = { NULL, user_fn, NULL } \ |
51 | } | 50 | } |
52 | 51 | ||
53 | #define ACTION_TAP_DANCE_FN_ANYWAY(user_fn, user_fn_anyway) { \ | 52 | #define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \ |
54 | .type = QK_TAP_DANCE_TYPE_FN, \ | 53 | .type = QK_TAP_DANCE_TYPE_FN, \ |
55 | .fn = { user_fn, user_fn_anyway, NULL } \ | 54 | .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ |
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 } \ | ||
66 | } | 55 | } |
67 | 56 | ||
68 | extern const qk_tap_dance_action_t tap_dance_actions[]; | 57 | extern const qk_tap_dance_action_t tap_dance_actions[]; |