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.
pull/238/head
ejinks4 7 years ago committed by GitHub
parent 67aa56022d
commit 263f9a59c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,9 +8,7 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) {
if (!(mappedKey.flags & SYNTHETIC)) if (!(mappedKey.flags & SYNTHETIC))
return false; return false;
if (mappedKey.flags & IS_INTERNAL) { if (mappedKey.flags & IS_CONSUMER) {
return false;
} else if (mappedKey.flags & IS_CONSUMER) {
if (keyIsPressed(keyState)) { if (keyIsPressed(keyState)) {
} else if (keyWasPressed(keyState)) { } else if (keyWasPressed(keyState)) {
kaleidoscope::hid::pressConsumerControl(mappedKey); kaleidoscope::hid::pressConsumerControl(mappedKey);
@ -22,6 +20,8 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) {
kaleidoscope::hid::pressSystemControl(mappedKey); kaleidoscope::hid::pressSystemControl(mappedKey);
kaleidoscope::hid::releaseSystemControl(mappedKey); kaleidoscope::hid::releaseSystemControl(mappedKey);
} }
} else if (mappedKey.flags & IS_INTERNAL) {
return false;
} else if (mappedKey.flags & SWITCH_TO_KEYMAP) { } else if (mappedKey.flags & SWITCH_TO_KEYMAP) {
// Should not happen, handled elsewhere. // Should not happen, handled elsewhere.
} }

Loading…
Cancel
Save