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 <algernon@keyboard.io>
pull/508/head
Gergely Nagy 6 years ago
parent eda312d392
commit 7528497682
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

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

Loading…
Cancel
Save