2016-12-09 22:49:11 +00:00
|
|
|
#ifndef PROCESS_COMBO_H
|
|
|
|
#define PROCESS_COMBO_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "progmem.h"
|
|
|
|
#include "quantum.h"
|
|
|
|
|
2016-12-10 14:11:59 +00:00
|
|
|
#ifndef COMBO_TERM
|
|
|
|
#define COMBO_TERM TAPPING_TERM
|
|
|
|
#endif
|
2016-12-09 22:49:11 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const uint16_t *keys;
|
|
|
|
uint16_t action;
|
|
|
|
uint32_t state;
|
2016-12-10 14:11:59 +00:00
|
|
|
#if COMBO_TERM
|
|
|
|
uint16_t timer;
|
|
|
|
uint16_t key;
|
|
|
|
#endif
|
2016-12-09 22:49:11 +00:00
|
|
|
} combo_t;
|
|
|
|
|
|
|
|
|
2016-12-10 14:11:59 +00:00
|
|
|
#if COMBO_TERM
|
|
|
|
#define COMBO(ck, ca) {.keys = &(ck)[0], .action = (ca), .state = 0, .timer = 0, .key = 0}
|
|
|
|
#else
|
|
|
|
#define COMBO(ck, ca) {.keys = &(ck)[0], .action = (ca), .state = 0 }
|
|
|
|
#endif
|
2016-12-09 22:49:11 +00:00
|
|
|
#define COMBO_END 0
|
2016-12-10 14:11:59 +00:00
|
|
|
#ifndef COMBO_COUNT
|
|
|
|
#define COMBO_COUNT 0
|
|
|
|
#endif
|
2016-12-09 22:49:11 +00:00
|
|
|
|
2016-12-10 14:11:59 +00:00
|
|
|
extern combo_t key_combos[COMBO_COUNT];
|
2016-12-09 22:49:11 +00:00
|
|
|
|
|
|
|
bool process_combo(uint16_t keycode, keyrecord_t *record);
|
2016-12-10 14:11:59 +00:00
|
|
|
void matrix_scan_combo(void);
|
2016-12-09 22:49:11 +00:00
|
|
|
|
|
|
|
#endif
|