diff options
Diffstat (limited to 'users/greatwizard/tap_dances.h')
| -rw-r--r-- | users/greatwizard/tap_dances.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/users/greatwizard/tap_dances.h b/users/greatwizard/tap_dances.h new file mode 100644 index 000000000..944ae4555 --- /dev/null +++ b/users/greatwizard/tap_dances.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* Copyright 2020 Guillaume Gérard | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #pragma once | ||
| 17 | |||
| 18 | #include QMK_KEYBOARD_H | ||
| 19 | #include "greatwizard.h" | ||
| 20 | |||
| 21 | typedef struct { | ||
| 22 | bool is_press_action; | ||
| 23 | uint8_t state; | ||
| 24 | } tap; | ||
| 25 | |||
| 26 | enum { | ||
| 27 | SINGLE_TAP = 1, | ||
| 28 | SINGLE_HOLD, | ||
| 29 | DOUBLE_TAP, | ||
| 30 | DOUBLE_HOLD, | ||
| 31 | DOUBLE_SINGLE_TAP, | ||
| 32 | TRIPLE_TAP, | ||
| 33 | TRIPLE_HOLD | ||
| 34 | }; | ||
| 35 | |||
| 36 | enum { | ||
| 37 | #ifdef TAP_DANCE_LALT_GIT | ||
| 38 | TD_LALT_GIT, | ||
| 39 | #endif | ||
| 40 | #ifdef TAP_DANCE_LSFT_CAPS | ||
| 41 | TD_LSFT_CAPS, | ||
| 42 | # ifdef LAYERS_PROGRAMMER | ||
| 43 | TD_PG_LSFT_CAPS, | ||
| 44 | # endif | ||
| 45 | #endif | ||
| 46 | }; | ||
| 47 | |||
| 48 | uint8_t cur_dance(qk_tap_dance_state_t *state); | ||
| 49 | |||
| 50 | #ifdef TAP_DANCE_LALT_GIT | ||
| 51 | void lalt_finished(qk_tap_dance_state_t *state, void *user_data); | ||
| 52 | void lalt_reset(qk_tap_dance_state_t *state, void *user_data); | ||
| 53 | # define TD_LALT TD(TD_LALT_GIT) | ||
| 54 | #endif | ||
| 55 | |||
| 56 | #ifdef TAP_DANCE_LSFT_CAPS | ||
| 57 | # ifdef LAYERS_PROGRAMMER | ||
| 58 | void pg_lsft_finished(qk_tap_dance_state_t *state, void *user_data); | ||
| 59 | void pg_lsft_reset(qk_tap_dance_state_t *state, void *user_data); | ||
| 60 | # endif | ||
| 61 | #endif | ||
| 62 | |||
| 63 | #ifdef TAP_DANCE_LSFT_CAPS | ||
| 64 | # define TD_LSCP TD(TD_LSFT_CAPS) | ||
| 65 | #endif | ||
