diff --git a/src/kaleidoscope/hid.h b/src/kaleidoscope/hid.h index db68ca32..d4b4d30e 100644 --- a/src/kaleidoscope/hid.h +++ b/src/kaleidoscope/hid.h @@ -9,7 +9,7 @@ namespace hid { extern void initializeKeyboard(); -extern void pressKey(Key mappedKey); +extern void pressKey(Key mappedKey, boolean toggledOn = true); extern void releaseKey(Key mappedKey); extern void releaseAllKeys(); extern void pressRawKey(Key mappedKey); diff --git a/src/key_events.cpp b/src/key_events.cpp index 1a7d06cb..849916df 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -33,8 +33,10 @@ static bool handleKeyswitchEventDefault(Key mappedKey, byte row, byte col, uint8 if (mappedKey.flags & SYNTHETIC) { handleSyntheticKeyswitchEvent(mappedKey, keyState); - } else if (keyIsPressed(keyState)) { + } else if (keyToggledOn(keyState)) { kaleidoscope::hid::pressKey(mappedKey); + } else if (keyIsPressed(keyState)) { + kaleidoscope::hid::pressKey(mappedKey, false); } else if (keyToggledOff(keyState) && (keyState & INJECTED)) { kaleidoscope::hid::releaseKey(mappedKey); }