From 263f9a59c33e84b56978829cb17382f8b2dd40f0 Mon Sep 17 00:00:00 2001 From: ejinks4 <33394319+ejinks4@users.noreply.github.com> Date: Sun, 5 Nov 2017 20:46:45 -0500 Subject: [PATCH] Update key_events.cpp (IS_INTERNAL Handling) Reordered if chain in handleSyntheticKeyswitchEvent to fix a bug preventing some Consumer and System Control HID functions from being sent due to bit overload/collision with the IS_INTERNAL flag. --- src/key_events.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/key_events.cpp b/src/key_events.cpp index d7fe83fa..2d070777 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -8,9 +8,7 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) { if (!(mappedKey.flags & SYNTHETIC)) return false; - if (mappedKey.flags & IS_INTERNAL) { - return false; - } else if (mappedKey.flags & IS_CONSUMER) { + if (mappedKey.flags & IS_CONSUMER) { if (keyIsPressed(keyState)) { } else if (keyWasPressed(keyState)) { kaleidoscope::hid::pressConsumerControl(mappedKey); @@ -22,6 +20,8 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) { kaleidoscope::hid::pressSystemControl(mappedKey); kaleidoscope::hid::releaseSystemControl(mappedKey); } + } else if (mappedKey.flags & IS_INTERNAL) { + return false; } else if (mappedKey.flags & SWITCH_TO_KEYMAP) { // Should not happen, handled elsewhere. }