summaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode/process_leader.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_leader.c')
-rw-r--r--quantum/process_keycode/process_leader.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c
index ae00b3227a..b74b4927a8 100644
--- a/quantum/process_keycode/process_leader.c
+++ b/quantum/process_keycode/process_leader.c
@@ -54,11 +54,13 @@ bool process_leader(uint16_t keycode, keyrecord_t *record) {
# endif // LEADER_NO_TIMEOUT
{
# ifndef LEADER_KEY_STRICT_KEY_PROCESSING
- if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
- keycode = keycode & 0xFF;
+ if (IS_QK_MOD_TAP(keycode)) {
+ keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode);
+ } else if (IS_QK_LAYER_TAP(keycode)) {
+ keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode);
}
# endif // LEADER_KEY_STRICT_KEY_PROCESSING
- if (leader_sequence_size < (sizeof(leader_sequence) / sizeof(leader_sequence[0]))) {
+ if (leader_sequence_size < ARRAY_SIZE(leader_sequence)) {
leader_sequence[leader_sequence_size] = keycode;
leader_sequence_size++;
} else {
@@ -72,7 +74,7 @@ bool process_leader(uint16_t keycode, keyrecord_t *record) {
return false;
}
} else {
- if (keycode == KC_LEAD) {
+ if (keycode == QK_LEADER) {
qk_leader_start();
}
}