|
|
@ -3,11 +3,10 @@
|
|
|
|
#include "Kaleidoscope.h"
|
|
|
|
#include "Kaleidoscope.h"
|
|
|
|
#include "layers.h"
|
|
|
|
#include "layers.h"
|
|
|
|
|
|
|
|
|
|
|
|
bool NumLock_::isActive;
|
|
|
|
|
|
|
|
byte NumLock_::row = 255, NumLock_::col = 255;
|
|
|
|
byte NumLock_::row = 255, NumLock_::col = 255;
|
|
|
|
|
|
|
|
uint8_t NumLock_::numPadLayer;
|
|
|
|
cRGB numpad_color = CRGB(255, 0, 0);
|
|
|
|
cRGB numpad_color = CRGB(255, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NumLock_::NumLock_(void) {
|
|
|
|
NumLock_::NumLock_(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -16,7 +15,7 @@ void NumLock_::begin(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void NumLock_::loopHook(bool postClear) {
|
|
|
|
void NumLock_::loopHook(bool postClear) {
|
|
|
|
if (!postClear || !isActive)
|
|
|
|
if (!postClear || !Layer.isOn(numPadLayer))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t r = 0; r < ROWS; r++) {
|
|
|
|
for (uint8_t r = 0; r < ROWS; r++) {
|
|
|
@ -37,9 +36,9 @@ void NumLock_::loopHook(bool postClear) {
|
|
|
|
LEDControl.led_set_crgb_at(row, col, color);
|
|
|
|
LEDControl.led_set_crgb_at(row, col, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const macro_t *NumLock_::toggle(byte row_, byte col_, uint8_t numPadLayer) {
|
|
|
|
const macro_t *NumLock_::toggle() {
|
|
|
|
row = row_;
|
|
|
|
row = Macros.row;
|
|
|
|
col = col_;
|
|
|
|
col = Macros.col;
|
|
|
|
|
|
|
|
|
|
|
|
if (Layer.isOn(numPadLayer)) {
|
|
|
|
if (Layer.isOn(numPadLayer)) {
|
|
|
|
Layer.off(numPadLayer);
|
|
|
|
Layer.off(numPadLayer);
|
|
|
@ -47,7 +46,6 @@ const macro_t *NumLock_::toggle(byte row_, byte col_, uint8_t numPadLayer) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Layer.on(numPadLayer);
|
|
|
|
Layer.on(numPadLayer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
isActive = Layer.isOn(numPadLayer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return MACRO(T(KeypadNumLock), END);
|
|
|
|
return MACRO(T(KeypadNumLock), END);
|
|
|
|
}
|
|
|
|
}
|
|
|
|