|
|
@ -12,6 +12,13 @@ void NumPad_::begin(void) {
|
|
|
|
Kaleidoscope.useLoopHook(loopHook);
|
|
|
|
Kaleidoscope.useLoopHook(loopHook);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void syncNumlock(bool state) {
|
|
|
|
|
|
|
|
bool numState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK);
|
|
|
|
|
|
|
|
if (numState != state) {
|
|
|
|
|
|
|
|
kaleidoscope::hid::pressKey(Key_KeypadNumLock);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void NumPad_::loopHook(bool postClear) {
|
|
|
|
void NumPad_::loopHook(bool postClear) {
|
|
|
|
if (!postClear)
|
|
|
|
if (!postClear)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -19,16 +26,14 @@ void NumPad_::loopHook(bool postClear) {
|
|
|
|
if (!Layer.isOn(numPadLayer)) {
|
|
|
|
if (!Layer.isOn(numPadLayer)) {
|
|
|
|
if (!cleanupDone) {
|
|
|
|
if (!cleanupDone) {
|
|
|
|
LEDControl.set_mode(LEDControl.get_mode_index());
|
|
|
|
LEDControl.set_mode(LEDControl.get_mode_index());
|
|
|
|
|
|
|
|
syncNumlock(false);
|
|
|
|
cleanupDone = true;
|
|
|
|
cleanupDone = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cleanupDone = false;
|
|
|
|
cleanupDone = false;
|
|
|
|
bool numState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK);
|
|
|
|
syncNumlock(true);
|
|
|
|
if (!numState) {
|
|
|
|
|
|
|
|
kaleidoscope::hid::pressKey(Key_KeypadNumLock);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LEDControl.set_mode(LEDControl.get_mode_index());
|
|
|
|
LEDControl.set_mode(LEDControl.get_mode_index());
|
|
|
|
|
|
|
|
|
|
|
|