1kc / razer-macos

Color effects manager for Razer devices for macOS. Supports High Sierra (10.13) to Monterey (12.0). Made by the community, based on openrazer.
GNU General Public License v2.0
2.34k stars 254 forks source link

Cynosa V2 keyboard doesn't light up when unplugged then re-plugged #529

Open unnamed7 opened 2 years ago

unnamed7 commented 2 years ago

If you unplug cynosa v2 from mac mini m1, switch it to a PC with razer synapse 3 using a usb selector, then switch back to osx, the light set on the keyboard sets to the state previously had on osx, but it seems to reset soon after the state is activated. It looks like the keyboard fades out on disconnection from the PC, and OSX sets the state before the fade-out ends on the keyboard. I.e. PC sets to a state, disconnect from PC, the keyboard starts the fade out, connect to OSX, OSX sets the new state, then the fade out ends on the keyboard making the backlight turned off. This only happens if the keyboard is switched to PC, if I physically unpluig the keyboard from the OSX then re-plugged in, the "On system plugged in" event works no problem.

There needs to be some kind of timer after the connection event triggers or a way to detect the end of fade out. I wouldn't mind changing the source around this myself but have a problem compiling it. So can anyone help? Thanks in advance.

dhobi commented 2 years ago

Currently, we only support the "app" events of electron. It would be nice for sure to have some additional "add/remove/change" events when Razer devices are plugged in/out. Even if there would already be some npm usb packages doing just that I'd (personally) rather see this implemented in the core Razer macOS lib as it could as well benefit from knowing when a device handle should get cleaned up / be refreshed.