From 8bb9bb37ca76caa1f79ca615b1b921576e51e2ad Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 26 Jul 2017 12:58:41 -0700 Subject: [PATCH] make consumercontrol and systemcontrol events only fire on key release rather than send key down events for a while before sending a key release event as we did with the old scheme, this sends the events paired together as "one shot". This is closer to the spec and what OSX needs to accept these events --- src/key_events.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/key_events.cpp b/src/key_events.cpp index 981c34b8..85f01679 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -12,14 +12,14 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) { return false; } else if (mappedKey.flags & IS_CONSUMER) { if (keyIsPressed(keyState)) { - kaleidoscope::hid::pressConsumerControl(mappedKey); } else if (keyWasPressed(keyState)) { + kaleidoscope::hid::pressConsumerControl(mappedKey); kaleidoscope::hid::releaseConsumerControl(mappedKey); } } else if (mappedKey.flags & IS_SYSCTL) { if (keyIsPressed(keyState)) { - kaleidoscope::hid::pressSystemControl(mappedKey); } else if (keyWasPressed(keyState)) { + kaleidoscope::hid::pressSystemControl(mappedKey); kaleidoscope::hid::releaseSystemControl(mappedKey); } } else if (mappedKey.flags & SWITCH_TO_KEYMAP) {