Only try to reset the numlock led if we actually haven't done the

cleanup

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/365/head
Jesse Vincent 6 years ago
parent 7c1a5cea95
commit 79996b7216

@ -45,17 +45,16 @@ void NumPad_::syncNumlockState(bool state) {
void NumPad_::cleanupNumlockState() { void NumPad_::cleanupNumlockState() {
bool numLockLEDState = getNumlockState();
if (!cleanupDone) { if (!cleanupDone) {
bool numLockLEDState = getNumlockState();
LEDControl.set_mode(LEDControl.get_mode_index()); LEDControl.set_mode(LEDControl.get_mode_index());
if (!originalNumLockState) { if (!originalNumLockState) {
syncNumlockState(false); syncNumlockState(false);
numLockLEDState = false; numLockLEDState = false;
} }
cleanupDone = true; cleanupDone = true;
}
originalNumLockState = numLockLEDState; originalNumLockState = numLockLEDState;
}
} }

Loading…
Cancel
Save