From f6d627602e08b71ffb1e33b9fd8126490d1fd7d3 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Mon, 20 Nov 2017 14:05:44 -0600 Subject: [PATCH] Only call updateLiveCompositeKeymap() on key press; not release If we call updateLiveCompositeKeymap() on key release the keymap gets updated before the release event occurs, and any ShiftToLayer(N) key with a different definition on layer N won't work properly. Before its release event is processed, it gets updated to the new value, and layer N doesn't get turned off. If we only update the live keymap on key press events, we don't have this problem. --- src/key_events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/key_events.cpp b/src/key_events.cpp index 2d070777..e87e260e 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -60,7 +60,7 @@ void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState) { /* If a key had an on or off event, we update the live composite keymap. See * layers.h for an explanation about the different caches we have. */ - if (keyToggledOn(keyState) || keyToggledOff(keyState)) + if (keyToggledOn(keyState)) Layer.updateLiveCompositeKeymap(row, col); /* If the key we are dealing with is masked, ignore it until it is released.