diff options
author | Jeremy Bernhardt <bernhardtjeremy@gmail.com> | 2020-03-22 07:17:26 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 00:17:26 +1100 |
commit | e5d34fd084a7bdde0867749470b27c50e8144eb8 (patch) | |
tree | 9b7e094ae0be934a7c333680582f069a699d9daf | |
parent | bfb2f8e0a8f809374fdec102eb02c3bce46a14ee (diff) | |
download | qmk_firmware-e5d34fd084a7bdde0867749470b27c50e8144eb8.tar.gz qmk_firmware-e5d34fd084a7bdde0867749470b27c50e8144eb8.zip |
Variable combo (#8120)
* keymap(gergo): colemak
* added flipped numbers
* add STENO_DISABLE_VIRTSER
* add STENO_DISABLE_VIRTSER
* Added GergoPlex and Faunchpad
* push retab
* push retab
* added variable option for combos
* removed accidental commit
* removed accidental commit
* More accidental deletions! (╯°□°)╯︵ ┻━┻
Co-authored-by: Damien Rajon <145502+pyrho@users.noreply.github.com>
-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; |