-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Check for combos exceeding CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY at compile time. #2551
Comments
To be clear, I consider this an extremely minor nice-to-have. At some point I might take a crack at a PR for it, but only after learning more about ZMK internals 😄 |
If it's possible to calculate the number of combos using each key at compile time in order to check if it exceeds the max, then it should also be possible to just calculate what the max should be and eliminate the need for the setting entirely. (That said, the typical method of getting the max of a list of numbers with C macros increases exponentially in complexity with the size of the list, so we would need to be sure such a solution is feasible on large keyboards.) |
Could one overload One could run the config through the preprocessor first and then use python to parse and automate various settings. One might also do the same to improve error messages. E.g., showing the code corresponding to problematic columns after all macros have been expanded. |
I took a stab at this, and have a POC branch for adding static asserts to introduce compilation errors for excessive combos, here: angweekiat#1 I also tried to see if it's possible to calculate |
As a quality of life feature, it would be nice to have a way to automatically detect excess combos and issue a compile time warning. Or possibly even use that detection to implicitly increase the combo-per-key limit within reason.
Currently, if I overload a key with more combos than
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY
allows, it seems I silently lose the use of one or more of those combos. Rather than discovering this when I try to use that combo, I would prefer to have an error or warning when I (or the GH Action) go to build the firmware.The text was updated successfully, but these errors were encountered: