diff options
author | Ole Anders <git@swoy.org> | 2017-03-07 19:39:00 +0100 |
---|---|---|
committer | Ole Anders <git@swoy.org> | 2017-03-07 19:39:00 +0100 |
commit | 25a7c941746d077d246468bec6bebdb01e478090 (patch) | |
tree | 906b491bb1465be287ec4dc02e9857437f7582a6 /quantum/process_keycode/process_combo.h | |
parent | d1fb51976aeef8eeea5975c5bf75b6b1aa649826 (diff) | |
parent | f5c8c5d4c854c5ae4dc586066c9b03557786c4c2 (diff) |
Merge remote-tracking branch 'refs/remotes/qmk/master'
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 0000000000..847f2b7376 --- /dev/null +++ b/quantum/process_keycode/process_combo.h @@ -0,0 +1,43 @@ +#ifndef PROCESS_COMBO_H +#define PROCESS_COMBO_H + +#include <stdint.h> +#include "progmem.h" +#include "quantum.h" + +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 + uint8_t state; +#endif + uint16_t timer; +#ifdef COMBO_ALLOW_ACTION_KEYS + keyrecord_t prev_record; +#else + uint16_t prev_key; +#endif +} combo_t; + + +#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)} +#define COMBO_ACTION(ck) {.keys = &(ck)[0]} + +#define COMBO_END 0 +#ifndef COMBO_COUNT +#define COMBO_COUNT 0 +#endif +#ifndef COMBO_TERM +#define COMBO_TERM TAPPING_TERM +#endif + +bool process_combo(uint16_t keycode, keyrecord_t *record); +void matrix_scan_combo(void); +void process_combo_event(uint8_t combo_index, bool pressed); + +#endif |