diff options
author | Nick Brassel <[email protected]> | 2023-11-28 16:39:48 +1100 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2023-11-28 16:40:47 +1100 |
commit | 0115951de12bd4c798a43a380651c34552552e85 (patch) | |
tree | 62999011ae782d93aa6dc9c889615db2a840cafc /users/billypython/tap_dance.c | |
parent | 0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff) | |
parent | 4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff) | |
download | qmk_firmware-0.23.0.tar.gz qmk_firmware-0.23.0.zip |
`develop` -> `master`, 2023q4 edition0.23.0
Diffstat (limited to 'users/billypython/tap_dance.c')
-rw-r--r-- | users/billypython/tap_dance.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/users/billypython/tap_dance.c b/users/billypython/tap_dance.c deleted file mode 100644 index c55f9e9133..0000000000 --- a/users/billypython/tap_dance.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "tap_dance.h" - -#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ - .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ - .user_data = &(tap_dance_pair_t){ mod1, mod2 }, \ - } - -void td_double_mods_each(tap_dance_state_t *state, void *user_data) { - tap_dance_pair_t *mods = (tap_dance_pair_t *)user_data; - // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 - if (state->count == 1 || state->count == 3) { - register_code(mods->kc1); - } else if (state->count == 2) { - unregister_code(mods->kc1); - register_code(mods->kc2); - } - // Prevent tap dance from sending kc1 and kc2 as weak mods - state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2)); -} - -void td_double_mods_reset(tap_dance_state_t *state, void *user_data) { - tap_dance_pair_t *mods = (tap_dance_pair_t *)user_data; - if (state->count == 1 || state->count >= 3) { - unregister_code(mods->kc1); - } - if (state->count >= 2) { - unregister_code(mods->kc2); - } -} - -tap_dance_action_t tap_dance_actions[] = { - [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL), -}; |