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

Create a zmk_keyboard option for physical layouts #150

Open
caksoylar opened this issue Jan 21, 2025 · 0 comments
Open

Create a zmk_keyboard option for physical layouts #150

caksoylar opened this issue Jan 21, 2025 · 0 comments

Comments

@caksoylar
Copy link
Owner

When parsing a ZMK layout with keymap parse -z <keyboard>.keymap, we look up the keymap filename, infer the ZMK keyboard name, and then look up if it exists in https://github.com/caksoylar/keymap-drawer/blob/main/resources/zmk_keyboard_layouts.yaml. If it doesn't, then we don't output a layout field in the keymap YAML and expect the user to correct it in the keymap draw call.

Instead of this implicit workflow, we can make the concept of ZMK keyboard name explicit by simply outputting layout: { zmk_keyboard: <keyboard> } and defer any mapping look-ups to the draw phase. This allows us to do a few things better:

  • Maintain a separate database of ZMK layouts, without a qmk_keyboard indirection
  • Even if the keyboard name is not known, parse and output the layout_name for the chosen physical layout/matrix transform
    • This can then be combined with --dts-layout/--qmk-info-json to keymap draw, where it can be used to choose between multiple layouts (without having to manually provide --layout-name)
    • This will particularly help the CI workflow, since we can look-up a overlay/dts/dtsi that contains the layout and not have to blindly select one of the defined layouts in it
  • No longer exposing to the user the term qmk_keyboard when what they do has nothing to do with QMK

Implementation shouldn't be hard, we just need to expose zmk_keyboard/--zmk-keyboard options, output it via keymap parse, and move the layout mappings to happen during keymap draw instead.

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