diff options
| -rw-r--r-- | quantum/process_keycode/process_combo.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index f40ca7452..25a606063 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c | |||
| @@ -17,9 +17,12 @@ | |||
| 17 | #include "print.h" | 17 | #include "print.h" |
| 18 | #include "process_combo.h" | 18 | #include "process_combo.h" |
| 19 | 19 | ||
| 20 | __attribute__((weak)) combo_t key_combos[COMBO_COUNT] = { | 20 | #ifndef COMBO_VARIABLE_LEN |
| 21 | 21 | __attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {}; | |
| 22 | }; | 22 | #else |
| 23 | extern combo_t key_combos[]; | ||
| 24 | extern int COMBO_LEN; | ||
| 25 | #endif | ||
| 23 | 26 | ||
| 24 | __attribute__((weak)) void process_combo_event(uint8_t combo_index, bool pressed) {} | 27 | __attribute__((weak)) void process_combo_event(uint8_t combo_index, bool pressed) {} |
| 25 | 28 | ||
| @@ -141,8 +144,11 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) { | |||
| 141 | if (!is_combo_enabled()) { | 144 | if (!is_combo_enabled()) { |
| 142 | return true; | 145 | return true; |
| 143 | } | 146 | } |
| 144 | 147 | #ifndef COMBO_VARIABLE_LEN | |
| 145 | for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) { | 148 | for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) { |
| 149 | #else | ||
| 150 | for (current_combo_index = 0; current_combo_index < COMBO_LEN; ++current_combo_index) { | ||
| 151 | #endif | ||
| 146 | combo_t *combo = &key_combos[current_combo_index]; | 152 | combo_t *combo = &key_combos[current_combo_index]; |
| 147 | is_combo_key |= process_single_combo(combo, keycode, record); | 153 | is_combo_key |= process_single_combo(combo, keycode, record); |
| 148 | no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN; | 154 | no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN; |
