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

C Header Split: Public vs Internal #2619

Open
petejohanson opened this issue Nov 8, 2024 · 2 comments
Open

C Header Split: Public vs Internal #2619

petejohanson opened this issue Nov 8, 2024 · 2 comments
Labels
core Core functionality/behavior of ZMK refactor

Comments

@petejohanson
Copy link
Contributor

As we plan for versioning, we need to be diligent about what C API we consider public, with stability guarantees, changes triggering major version changes, etc.

To that effect, we need to split our headers into public and internal headers, to clearly differentiate these things.

Suggested public API/headers:

  • Behaviors driver API
  • Event manager API
  • Events themselves

Maybe Public:

  • HID
  • Endpoints
  • Some display widgets APIs?
  • behavior queue?

Private:

  • Keymaps
  • Physical Layouts
  • matrix transforms
  • Backlight
  • Underglow
  • PM?
@petejohanson petejohanson added core Core functionality/behavior of ZMK refactor labels Nov 8, 2024
@caksoylar
Copy link
Contributor

caksoylar commented Nov 8, 2024

IMO the public API would be used by these types of modules mainly (referring to the categorization in #2456):

  • Custom behaviors
  • Custom status screens
  • Other types of indicators like rgbled-widget

I think the following should be public for use in custom behaviors, other than your suggested public ones:

  • behavior queue (in "maybe" above, needed for macro-like behaviors)
  • some keymap APIs like fetching active layers, setting layers on/off

For custom status screens and status indicators:

  • Display widget creation APIs
  • again, some keymap APIs related to layers
  • selected endpoint

In the future we might want to consider adding hooks for custom lighting status effects, like the ones that could be used by Glove80 magic key to display status indicators. I assume this requires re-architecting underglow a bit, to allow for loading external effects. In that case I can see related APIs being public too.

@joelspadin
Copy link
Collaborator

Rather than rearchitecting underglow a bit to allow loading external effects, it might be less work in the long run to do nothing now and later rearchitect it completely with a generic lighting system that can handle things like per-key lighting as well. I think a lighting effect driver API would be a much more flexible way to handle custom lighting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality/behavior of ZMK refactor
Projects
None yet
Development

No branches or pull requests

3 participants