summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJeremy Bernhardt <bernhardtjeremy@gmail.com>2020-03-22 07:17:26 -0600
committerGitHub <noreply@github.com>2020-03-23 00:17:26 +1100
commite5d34fd084a7bdde0867749470b27c50e8144eb8 (patch)
tree9b7e094ae0be934a7c333680582f069a699d9daf /quantum
parentbfb2f8e0a8f809374fdec102eb02c3bce46a14ee (diff)
downloadqmk_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>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/process_keycode/process_combo.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index f40ca74525..25a6060639 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -17,9 +17,12 @@
#include "print.h"
#include "process_combo.h"
-__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {
-
-};
+#ifndef COMBO_VARIABLE_LEN
+__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {};
+#else
+extern combo_t key_combos[];
+extern int COMBO_LEN;
+#endif
__attribute__((weak)) void process_combo_event(uint8_t combo_index, bool pressed) {}
@@ -141,8 +144,11 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
if (!is_combo_enabled()) {
return true;
}
-
+#ifndef COMBO_VARIABLE_LEN
for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) {
+#else
+ for (current_combo_index = 0; current_combo_index < COMBO_LEN; ++current_combo_index) {
+#endif
combo_t *combo = &key_combos[current_combo_index];
is_combo_key |= process_single_combo(combo, keycode, record);
no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN;