diff options
Diffstat (limited to 'quantum/process_keycode/process_combo.h')
| -rw-r--r-- | quantum/process_keycode/process_combo.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h new file mode 100644 index 000000000..847f2b737 --- /dev/null +++ b/quantum/process_keycode/process_combo.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #ifndef PROCESS_COMBO_H | ||
| 2 | #define PROCESS_COMBO_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include "progmem.h" | ||
| 6 | #include "quantum.h" | ||
| 7 | |||
| 8 | typedef struct | ||
| 9 | { | ||
| 10 | const uint16_t *keys; | ||
| 11 | uint16_t keycode; | ||
| 12 | #ifdef EXTRA_EXTRA_LONG_COMBOS | ||
| 13 | uint32_t state; | ||
| 14 | #elif EXTRA_LONG_COMBOS | ||
| 15 | uint16_t state; | ||
| 16 | #else | ||
| 17 | uint8_t state; | ||
| 18 | #endif | ||
| 19 | uint16_t timer; | ||
| 20 | #ifdef COMBO_ALLOW_ACTION_KEYS | ||
| 21 | keyrecord_t prev_record; | ||
| 22 | #else | ||
| 23 | uint16_t prev_key; | ||
| 24 | #endif | ||
| 25 | } combo_t; | ||
| 26 | |||
| 27 | |||
| 28 | #define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)} | ||
| 29 | #define COMBO_ACTION(ck) {.keys = &(ck)[0]} | ||
| 30 | |||
| 31 | #define COMBO_END 0 | ||
| 32 | #ifndef COMBO_COUNT | ||
| 33 | #define COMBO_COUNT 0 | ||
| 34 | #endif | ||
| 35 | #ifndef COMBO_TERM | ||
| 36 | #define COMBO_TERM TAPPING_TERM | ||
| 37 | #endif | ||
| 38 | |||
| 39 | bool process_combo(uint16_t keycode, keyrecord_t *record); | ||
| 40 | void matrix_scan_combo(void); | ||
| 41 | void process_combo_event(uint8_t combo_index, bool pressed); | ||
| 42 | |||
| 43 | #endif | ||
