From 75284976820e9e82c2e44c2f5a9f49fa72d12f3e Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 20 Dec 2018 15:28:27 +0100 Subject: [PATCH] LED-ActiveModColor: Use lookupOnActiveLayer() instead of lookup() When we use `lookup()`, we're looking up from the cache, not from the active layer. If the cache gets updated later than we're called, we won't notice. So do an explicit lookup. Fixes #507. Signed-off-by: Gergely Nagy --- src/kaleidoscope/plugin/LED-ActiveModColor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kaleidoscope/plugin/LED-ActiveModColor.cpp b/src/kaleidoscope/plugin/LED-ActiveModColor.cpp index 55906de4..9f8b5e1b 100644 --- a/src/kaleidoscope/plugin/LED-ActiveModColor.cpp +++ b/src/kaleidoscope/plugin/LED-ActiveModColor.cpp @@ -39,7 +39,7 @@ EventHandlerResult ActiveModColorEffect::onLayerChange() { for (byte r = 0; r < ROWS; r++) { for (byte c = 0; c < COLS; c++) { - Key k = Layer.lookup(r, c); + Key k = Layer.lookupOnActiveLayer(r, c); if (::OneShot.isOneShotKey(k) || (k.raw >= Key_LeftControl.raw && k.raw <= Key_RightGui.raw) || @@ -59,7 +59,7 @@ EventHandlerResult ActiveModColorEffect::beforeReportingState() { byte c = coords % COLS; byte r = (coords - c) / COLS; - Key k = Layer.lookup(r, c); + Key k = Layer.lookupOnActiveLayer(r, c); if (::OneShot.isOneShotKey(k)) { if (::OneShot.isSticky(k))