summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/quantum.c4
-rw-r--r--quantum/quantum.h10
2 files changed, 9 insertions, 5 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 49ac20d61f..006464e5a8 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -54,7 +54,7 @@ int offset = 7;
bool leading = false;
uint16_t leader_time = 0;
-uint16_t leader_sequence[3] = {0, 0, 0};
+uint16_t leader_sequence[5] = {0, 0, 0, 0, 0};
uint8_t leader_sequence_size = 0;
// Chording stuff
@@ -335,6 +335,8 @@ bool process_record_quantum(keyrecord_t *record) {
leader_sequence[0] = 0;
leader_sequence[1] = 0;
leader_sequence[2] = 0;
+ leader_sequence[3] = 0;
+ leader_sequence[4] = 0;
return false;
}
if (leading && timer_elapsed(leader_time) < LEADER_TIMEOUT) {
diff --git a/quantum/quantum.h b/quantum/quantum.h
index e15003805b..1f78f37177 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -54,11 +54,13 @@ extern uint32_t default_layer_state;
#ifndef LEADER_TIMEOUT
#define LEADER_TIMEOUT 200
#endif
- #define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0)
- #define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0)
- #define SEQ_THREE_KEYS(key1, key2, key3) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3))
+ #define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0)
+ #define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0)
+ #define SEQ_THREE_KEYS(key1, key2, key3) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == 0 && leader_sequence[4] == 0)
+ #define SEQ_FOUR_KEYS(key1, key2, key3, key4) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == 0)
+ #define SEQ_FIVE_KEYS(key1, key2, key3, key4, key5) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3) && leader_sequence[3] == (key4) && leader_sequence[4] == (key5))
- #define LEADER_EXTERNS() extern bool leading; extern uint16_t leader_time; extern uint16_t leader_sequence[3]; extern uint8_t leader_sequence_size
+ #define LEADER_EXTERNS() extern bool leading; extern uint16_t leader_time; extern uint16_t leader_sequence[5]; extern uint8_t leader_sequence_size
#define LEADER_DICTIONARY() if (leading && timer_elapsed(leader_time) > LEADER_TIMEOUT)
#endif