I think that the current setup is the correct one. I wouldn’t want to move
hostPowerManagementEventHandler, for two reasons:
- I’d like to give the end-user the option to not turn LEDs off on suspend. They might want to just dim it. Or turn turn it off slowly with an animation (since the keyboard stays powered even during the host’s suspend, it is possible to fade out the leds).
- Toggling LEDs off introduces a dependency on
LEDControl, which I’d like to avoid, because Kaleidoscope supports boards without LEDs, and the dependency there would be wrong. We could likely figure out a way to let the compiler optimize out
LEDControl in this case, but it is a lot easier if the default
hostPowerManagementEventHandler is free of dependencies.
Case in point, I have a KBD4x that I use with a laptop from time to time. It has no per-key LEDs, but has an underglow. As such, it does not use
When the host suspends, I made it do a little Knight Rider animation with the underglow, and it does a small, dim red pulsing animation (which lasts about 10 seconds) every ten minutes to remind me that the laptop is still on, just suspended, and perhaps I should turn it off instead. When the laptop resumes, the keyboard does a different kind of animation (random color splash on all leds for a few seconds).