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))
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.
}

Loading…
Cancel
Save