A fix for rollover from a mod-flagged key

This, along with the change
keyboardio/Kaleidoscope-HIDAdaptor-KeyboardioHID@a4368f13e7a1b58e, makes
it so a rollover from a key with a mod flag applied to one without will
not result in the flag from the modified key affecting the next keypress.
pull/347/head
Michael Richters 7 years ago committed by Jesse Vincent
parent 78ee633ea1
commit 97aa9b3ba4

@ -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);

@ -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);
}

Loading…
Cancel
Save