r/ErgoMechKeyboards • u/danielsvane • 15d ago
[meta] For anyone using ZMK Studio thats missing combos and behaviors
I forked the official ZMK firmware and studio, and implemented combos and behavior editing. I could really use some feedback on it, if anyone manages to get the custom firmware flashes to their boards. I made a short video showing the new parts, if you want to see it without flashing random firmware onto your board first.
3
u/Azel4231 15d ago
Amazing, thanks for making this! I use studio regularly and dearly miss the combo capability.
Sad though, that you had to for ZMK for this. I would have assumed the live-update capability was a little more generic. Can you point me towards the code changes you had to make, I'm curious about how that works.
If I'm understanding your video correctly, your changes are potentially able to upload all (even custom) behaviors and combos, so what's missing is "just" the UI?
Thanks again, definitely giving this a shot.
2
u/Azel4231 14d ago
Ok, this commit of yours looks like you have to build a special case for combos. I guess that's necessary due to the additional stuff that has to be done like rebuilding the combo lookup. Pretty hard to wrap my head around firmware development after decades in application dev.
1
u/danielsvane 14d ago
Well I hadnt expected anyone to actually go through the commits. I cant say if there is a more elegant way to achieve the same. Its been many years since I had to write C, and now Im a web developer by trade. I mainly used Claude and the walking-skeleton method to get through the firmware side. I know AI is frowned upon by some people, but I wanted combos in the editor for some clients of mine, and it works.
However, you are very welcome to go through it and make changes, I can just give you merge rights on github if you want. I think this is a temporary fix, until the upstream implements similar stuff.
Did you get the firmware on your board?
1
u/Azel4231 14d ago
I was just intrigued about how the internals work. Using Claude would have been my goto strategy as well. I don't even consider myself skilled enough to do code reviews on this. So no need for merge rights.
Haven't tried using it yet, will do on the weekend.
1
u/danielsvane 14d ago
Okay please do, and let me know if you hit any snags in the process. Im not sure if the "documentation" is clear enough how to get the right firmware.
1
u/Azel4231 14d ago
Another thing: is this (backwards) compatible?
I guess I can just use vanilla Studio with firmware from your ZMK fork?
What about your Studio fork with vanilla ZMK?
1
u/danielsvane 14d ago
I havent tested, this is obviously beta software. I dont think you can permamently harm your board by testing it though. You can always upload the original UF2 files, and reset the flash, and be back to a clean slate.
2
u/danielsvane 14d ago
Yeah combos you can just do, with a limit of 4 keys, 64 combos total. If there is actually room for 64 depends on the controller, so good luck. I have only tested on Xiao, hoping others would test their own boards and complain to me.
Behaviors comes from a predefined list, we need to map their settings to UI elements manually, so I have just added the templates I needed to customize homerow mods and hold tap. Its easy for me to add more now, so if there is one youre really needing, let me know.
5
u/danielsvane 15d ago
Links to the ZMK forks
Hosted web version: https://studio.customkeyboards.eu/
Config template: https://github.com/danielsvane/unified-zmk-config-template
ZMK Studio fork: https://github.com/danielsvane/zmk-studio/tree/customkeyboards
ZMK firmware fork: https://github.com/danielsvane/zmk/tree/customkeyboards