Merge pull request #347 from keyboardio/bug/mod-flag-rollover

mod flag rollover part 2
pull/349/head
Jesse Vincent 6 years ago committed by GitHub
commit 0e93f81280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ namespace hid {
extern void initializeKeyboard(); extern void initializeKeyboard();
extern void pressKey(Key mappedKey); extern void pressKey(Key mappedKey, boolean toggledOn = true);
extern void releaseKey(Key mappedKey); extern void releaseKey(Key mappedKey);
extern void releaseAllKeys(); extern void releaseAllKeys();
extern void pressRawKey(Key mappedKey); extern void pressRawKey(Key mappedKey);

@ -33,8 +33,10 @@ static bool handleKeyswitchEventDefault(Key mappedKey, byte row, byte col, uint8
if (mappedKey.flags & SYNTHETIC) { if (mappedKey.flags & SYNTHETIC) {
handleSyntheticKeyswitchEvent(mappedKey, keyState); handleSyntheticKeyswitchEvent(mappedKey, keyState);
} else if (keyIsPressed(keyState)) { } else if (keyToggledOn(keyState)) {
kaleidoscope::hid::pressKey(mappedKey); kaleidoscope::hid::pressKey(mappedKey);
} else if (keyIsPressed(keyState)) {
kaleidoscope::hid::pressKey(mappedKey, false);
} else if (keyToggledOff(keyState) && (keyState & INJECTED)) { } else if (keyToggledOff(keyState) && (keyState & INJECTED)) {
kaleidoscope::hid::releaseKey(mappedKey); kaleidoscope::hid::releaseKey(mappedKey);
} }

Loading…
Cancel
Save