diff options
| author | Ofer Plesser <plesserofer@gmail.com> | 2016-12-23 21:51:11 +0200 |
|---|---|---|
| committer | Ofer Plesser <plesserofer@gmail.com> | 2016-12-23 21:51:11 +0200 |
| commit | 01038ab54ca6c2858ea9e856c717a1129ffe4156 (patch) | |
| tree | 4a3205a41c05fef7f977b27c23af412764064785 | |
| parent | cae269b08b642b07ee06dec7120a784a3c3d7aab (diff) | |
| download | qmk_firmware-01038ab54ca6c2858ea9e856c717a1129ffe4156.tar.gz qmk_firmware-01038ab54ca6c2858ea9e856c717a1129ffe4156.zip | |
Added check that makes sure a code is a right modifier before considering it as one
| -rw-r--r-- | quantum/keymap.h | 1 | ||||
| -rw-r--r-- | quantum/quantum.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/quantum/keymap.h b/quantum/keymap.h index ae56d16c7..745c55279 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h | |||
| @@ -53,6 +53,7 @@ enum quantum_keycodes { | |||
| 53 | QK_LSFT = 0x0200, | 53 | QK_LSFT = 0x0200, |
| 54 | QK_LALT = 0x0400, | 54 | QK_LALT = 0x0400, |
| 55 | QK_LGUI = 0x0800, | 55 | QK_LGUI = 0x0800, |
| 56 | QK_RMODS_MIN = 0x1000, | ||
| 56 | QK_RCTL = 0x1100, | 57 | QK_RCTL = 0x1100, |
| 57 | QK_RSFT = 0x1200, | 58 | QK_RSFT = 0x1200, |
| 58 | QK_RALT = 0x1400, | 59 | QK_RALT = 0x1400, |
diff --git a/quantum/quantum.c b/quantum/quantum.c index f653564a6..63ffe2074 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -21,6 +21,8 @@ static void do_code16 (uint16_t code, void (*f) (uint8_t)) { | |||
| 21 | if (code & QK_LGUI) | 21 | if (code & QK_LGUI) |
| 22 | f(KC_LGUI); | 22 | f(KC_LGUI); |
| 23 | 23 | ||
| 24 | if (code < QK_RMODS_MIN) return; | ||
| 25 | |||
| 24 | if (code & QK_RCTL) | 26 | if (code & QK_RCTL) |
| 25 | f(KC_RCTL); | 27 | f(KC_RCTL); |
| 26 | if (code & QK_RSFT) | 28 | if (code & QK_RSFT) |
