diff options
| author | Nick Brassel <nick@tzarc.org> | 2022-03-09 19:29:00 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-09 19:29:00 +1100 |
| commit | 8d5eacb7dd76bfd45444ceb1efa9a9f840173552 (patch) | |
| tree | b6b8b641dd61f5de0c5b7ee1bf251f6a84043656 /quantum/process_keycode/process_combo.c | |
| parent | 7121a228eb204a0d697c97503ac7a28b762ab598 (diff) | |
Add support for encoder mapping. (#13286)
Diffstat (limited to 'quantum/process_keycode/process_combo.c')
| -rw-r--r-- | quantum/process_keycode/process_combo.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index efaf8fe0e9..d5a649adb3 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c | |||
| @@ -88,8 +88,6 @@ static queued_combo_t combo_buffer[COMBO_BUFFER_LENGTH]; | |||
| 88 | 88 | ||
| 89 | #define INCREMENT_MOD(i) i = (i + 1) % COMBO_BUFFER_LENGTH | 89 | #define INCREMENT_MOD(i) i = (i + 1) % COMBO_BUFFER_LENGTH |
| 90 | 90 | ||
| 91 | #define COMBO_KEY_POS ((keypos_t){.col = 254, .row = 254}) | ||
| 92 | |||
| 93 | #ifndef EXTRA_SHORT_COMBOS | 91 | #ifndef EXTRA_SHORT_COMBOS |
| 94 | /* flags are their own elements in combo_t struct. */ | 92 | /* flags are their own elements in combo_t struct. */ |
| 95 | # define COMBO_ACTIVE(combo) (combo->active) | 93 | # define COMBO_ACTIVE(combo) (combo->active) |
| @@ -140,12 +138,7 @@ static queued_combo_t combo_buffer[COMBO_BUFFER_LENGTH]; | |||
| 140 | static inline void release_combo(uint16_t combo_index, combo_t *combo) { | 138 | static inline void release_combo(uint16_t combo_index, combo_t *combo) { |
| 141 | if (combo->keycode) { | 139 | if (combo->keycode) { |
| 142 | keyrecord_t record = { | 140 | keyrecord_t record = { |
| 143 | .event = | 141 | .event = MAKE_KEYEVENT(KEYLOC_COMBO, KEYLOC_COMBO, false), |
| 144 | { | ||
| 145 | .key = COMBO_KEY_POS, | ||
| 146 | .time = timer_read() | 1, | ||
| 147 | .pressed = false, | ||
| 148 | }, | ||
| 149 | .keycode = combo->keycode, | 142 | .keycode = combo->keycode, |
| 150 | }; | 143 | }; |
| 151 | #ifndef NO_ACTION_TAPPING | 144 | #ifndef NO_ACTION_TAPPING |
| @@ -325,7 +318,7 @@ void apply_combo(uint16_t combo_index, combo_t *combo) { | |||
| 325 | if (ALL_COMBO_KEYS_ARE_DOWN(state, key_count)) { | 318 | if (ALL_COMBO_KEYS_ARE_DOWN(state, key_count)) { |
| 326 | // this in the end executes the combo when the key_buffer is dumped. | 319 | // this in the end executes the combo when the key_buffer is dumped. |
| 327 | record->keycode = combo->keycode; | 320 | record->keycode = combo->keycode; |
| 328 | record->event.key = COMBO_KEY_POS; | 321 | record->event.key = MAKE_KEYPOS(KEYLOC_COMBO, KEYLOC_COMBO); |
| 329 | 322 | ||
| 330 | qrecord->combo_index = combo_index; | 323 | qrecord->combo_index = combo_index; |
| 331 | ACTIVATE_COMBO(combo); | 324 | ACTIVATE_COMBO(combo); |
