Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide how to implement LED modes #20

Open
gedankenexperimenter opened this issue Apr 4, 2018 · 3 comments
Open

Decide how to implement LED modes #20

gedankenexperimenter opened this issue Apr 4, 2018 · 3 comments

Comments

@gedankenexperimenter
Copy link
Owner

No description provided.

@gedankenexperimenter
Copy link
Owner Author

Do I leave updating in core, or do I use a plugin, like Kaleidoscope's LEDControl module?

LED modes must still be plugins, because they might respond to input, but they needn't be called except via LEDControl. That way, inactive modes don't get their hook functions needlessly called.

Maybe there should be a global brightness scaling function that gets applied to all modes.

Instead of doing an array lookup, maybe a simple algorithm could translate values to output.

@gedankenexperimenter
Copy link
Owner Author

I think I want to go one step farther than Kaleidoscope's LEDControl, and have it pass through not just the LED-update functions, but also the hook functions.

On another note, the tricky part is when multiple plugins are all trying to update LEDs. Maybe there should be a two-phase update system, where plugins can update all LEDs (to a single color), then that can be overridden by others that set individual keys.

Furthermore, maybe I want to move the updates into the core, and have a hook function for LED updates, run just before the LEDs are updated by sending to the hardware. Maybe this would make it easier to optimize out that code on keyboards without lights, because those hook functions would never get called, because the update function in hooks doesn't get overridden?

@gedankenexperimenter
Copy link
Owner Author

One of the design goals should be to have an easy way to optimize out plugin code that exists only to update LEDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant