summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOfer Plesser <plesserofer@gmail.com>2016-12-23 21:51:11 +0200
committerOfer Plesser <plesserofer@gmail.com>2016-12-23 21:51:11 +0200
commit01038ab54ca6c2858ea9e856c717a1129ffe4156 (patch)
tree4a3205a41c05fef7f977b27c23af412764064785
parentcae269b08b642b07ee06dec7120a784a3c3d7aab (diff)
Added check that makes sure a code is a right modifier before considering it as one
-rw-r--r--quantum/keymap.h1
-rw-r--r--quantum/quantum.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/quantum/keymap.h b/quantum/keymap.h
index ae56d16c75..745c552799 100644
--- a/quantum/keymap.h
+++ b/quantum/keymap.h
@@ -53,6 +53,7 @@ enum quantum_keycodes {
QK_LSFT = 0x0200,
QK_LALT = 0x0400,
QK_LGUI = 0x0800,
+ QK_RMODS_MIN = 0x1000,
QK_RCTL = 0x1100,
QK_RSFT = 0x1200,
QK_RALT = 0x1400,
diff --git a/quantum/quantum.c b/quantum/quantum.c
index f653564a67..63ffe2074e 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -21,6 +21,8 @@ static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
if (code & QK_LGUI)
f(KC_LGUI);
+ if (code < QK_RMODS_MIN) return;
+
if (code & QK_RCTL)
f(KC_RCTL);
if (code & QK_RSFT)