Conversation
|
Hi! Cool project! I've done some tangentially related work to parse a zmk keyboard's layout, again to handle a situation where the user doesn't want to do the work manually. You'll want to look at the matrix transform in the It's an interesting pickle... zmk's keymap bindings array is inherently row based because, well, it's text, so columnar keyboards tend to be represented as ortholinear for ease of editing. Your layout description is explicitly column based (respect!) so you would need to define some mapping between the two. In my version I parse the locations of the |
|
Kudos, SonarCloud Quality Gate passed!
|








I've created a template system to support custom keyboard layouts that are not available in QMK Toolbox as suggested in #2.
The template uses YAML syntax and is quite simple with a few keywords available, it can be improved with some feedback.
This is an example template for S'mores Clog keyboard:
When running the command

zmk-viewer generate clog --template theClog.yamlthis is the image produced:It's also possible to use the template to parse

.keymapfiles using this syntax:zmk-viewer generate clog --template theClog.yaml -f clog.keymap:Currently, the template is generated from left to right & top to bottom while the keymap is parsed top to bottom & left to right.
This generates some inconsistencies in weird layouts when the keys are formatted to look like the keyboard, like in The Clog:
I'm not sure about how ZMK parses
.keymapfiles, if they take in account this order or not.