diff options
Diffstat (limited to 'quantum/process_keycode/process_combo.h')
-rw-r--r-- | quantum/process_keycode/process_combo.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h index a5787c9ed3..f06d2d3454 100644 --- a/quantum/process_keycode/process_combo.h +++ b/quantum/process_keycode/process_combo.h @@ -17,33 +17,34 @@ #ifndef PROCESS_COMBO_H #define PROCESS_COMBO_H -#include <stdint.h> #include "progmem.h" #include "quantum.h" +#include <stdint.h> -typedef struct -{ - const uint16_t *keys; - uint16_t keycode; #ifdef EXTRA_EXTRA_LONG_COMBOS - uint32_t state; +#define MAX_COMBO_LENGTH 32 #elif EXTRA_LONG_COMBOS - uint16_t state; +#define MAX_COMBO_LENGTH 16 #else - uint8_t state; +#define MAX_COMBO_LENGTH 8 #endif - uint16_t timer; - bool is_active; -#ifdef COMBO_ALLOW_ACTION_KEYS - keyrecord_t prev_record; + +typedef struct { + const uint16_t *keys; + uint16_t keycode; +#ifdef EXTRA_EXTRA_LONG_COMBOS + uint32_t state; +#elif EXTRA_LONG_COMBOS + uint16_t state; #else - uint16_t prev_key; + uint8_t state; #endif } combo_t; - -#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)} -#define COMBO_ACTION(ck) {.keys = &(ck)[0]} +#define COMBO(ck, ca) \ + { .keys = &(ck)[0], .keycode = (ca) } +#define COMBO_ACTION(ck) \ + { .keys = &(ck)[0] } #define COMBO_END 0 #ifndef COMBO_COUNT |