Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public deinit() {
this.keyboardEvents.removeSettingsListener(this.onSettingsChanged);
this.keyboardEvents.removeStateChangeListener(this.onStateChangeRequested);
// stop the redrawTimer
if (this.redrawTimer != null) {
clearTimeout(this.redrawTimer);
this.redrawTimer = null;
}
// restore the default rainbow pattern
this.restoreHardwareProfile();
// stop monitoring the usbs
usbDetect.stopMonitoring();
// disconnect from any current keyboard
this.disconnectKeyboard();
}
static stopMonitoring() {
if (this.motoringCallCount-- > 0 && this.motoringCallCount === 0) {
usbDetect.stopMonitoring();
}
}
public static stopMonitoring() {
if (--this.motoringCallCount === 0) {
usbDetect.stopMonitoring();
}
}