When in numlock, we should only light up the numpad keys, not everything else

pull/365/head
Jesse Vincent 7 years ago
parent b9f7ac0669
commit c575fd0d52
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -6,6 +6,7 @@
byte NumLock_::row = 255, NumLock_::col = 255; byte NumLock_::row = 255, NumLock_::col = 255;
uint8_t NumLock_::numPadLayer; uint8_t NumLock_::numPadLayer;
cRGB numpad_color = CRGB(255, 0, 0); cRGB numpad_color = CRGB(255, 0, 0);
cRGB off_color = CRGB(0, 0, 0);
NumLock_::NumLock_(void) { NumLock_::NumLock_(void) {
} }
@ -23,12 +24,13 @@ void NumLock_::loopHook(bool postClear) {
Key k = Layer.lookup(r, c); Key k = Layer.lookup(r, c);
Key layer_key = Layer.getKey(numPadLayer, r, c); Key layer_key = Layer.getKey(numPadLayer, r, c);
if ((k != layer_key) || (k.flags != KEY_FLAGS)) if ((k != layer_key) || (k.flags != KEY_FLAGS)) {
continue; LEDControl.setCrgbAt(r, c, off_color);
} else {
LEDControl.setCrgbAt(r, c, numpad_color); LEDControl.setCrgbAt(r, c, numpad_color);
} }
} }
}
if (row > ROWS || col > COLS) if (row > ROWS || col > COLS)
return; return;

Loading…
Cancel
Save