aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_combo.h
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-02-06 19:31:45 -0500
committerGitHub <noreply@github.com>2017-02-06 19:31:45 -0500
commit4348fb54d6eb80e8d82c0724be647631bdd524d3 (patch)
tree7e51344981e0e9daef487c3cbe7b4508735f91bf /quantum/process_keycode/process_combo.h
parentb6ffda484971306264c8c95facf75eec4c85b62a (diff)
parent40abf8bc9ce22cab472f79e3a97c413ac5648986 (diff)
downloadqmk_firmware-4348fb54d6eb80e8d82c0724be647631bdd524d3.tar.gz
qmk_firmware-4348fb54d6eb80e8d82c0724be647631bdd524d3.zip
Merge pull request #960 from ofples/feature/combos
Keyboard combination triggers
Diffstat (limited to 'quantum/process_keycode/process_combo.h')
-rw-r--r--quantum/process_keycode/process_combo.h43
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
8typedef 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
39bool process_combo(uint16_t keycode, keyrecord_t *record);
40void matrix_scan_combo(void);
41void process_combo_event(uint8_t combo_index, bool pressed);
42
43#endif