diff --git a/src/key_events.cpp b/src/key_events.cpp index 85f01679..7639cf5b 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -47,6 +47,14 @@ void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState) { if (!(keyState & INJECTED)) { mappedKey = Layer.lookup(row, col); } + + if (KeyboardHardware.isKeyMasked(row, col)) { + if (keyToggledOff(keyState)) { + KeyboardHardware.unMaskKey(row, col); + } + return; + } + for (byte i = 0; Kaleidoscope.eventHandlers[i] != NULL && i < HOOK_MAX; i++) { Kaleidoscope_::eventHandlerHook handler = Kaleidoscope.eventHandlers[i]; mappedKey = (*handler)(mappedKey, row, col, keyState); diff --git a/src/layers.cpp b/src/layers.cpp index cd48ed46..2d693175 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -28,6 +28,8 @@ static void handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState) { } else { Layer.off(target); } + + KeyboardHardware.maskHeldKeys(); } // switch keymap and stay there