KMKfw / kmk_firmware

Clackety Keyboards Powered by Python
https://kmkfw.zulipchat.com
Other
1.45k stars 485 forks source link

Create QMK Config Reader #863

Open Allstreamer opened 1 year ago

Allstreamer commented 1 year ago

I'm gonna work on making a parser for QMK configurator JSON files:

I'm thinking the API should look like this:

from kmk.kmk_keyboard import KMKKeyboard
from kmk.converters.qmk import read_qmk_config

keyboard = KMKKeyboard()

keyboard.keymap = read_qmk_config("config.json")

if __name__ == '__main__':
    keyboard.go()

Discussion that started this on zulipchat

TODO List:

daysgobye commented 1 year ago

Hey I have been working on something similar thought you should know. Maybe I can save you some work you can feel free to take any of it or none of it.

https://github.com/boardsource/peg_kmk_firmware/blob/master/src/kmk/json_keymap.py

https://github.com/boardsource/peg_kmk_firmware/blob/master/src/kmk/json_keyboard.py

https://github.com/boardsource/peg_kmk_firmware/blob/master/src/kmk/json_boot.py

These are the 3 files that I have been working on I still need to add tests and write docs.

This works by puting both a QMK info.json and keymap.json in one file.

My work does increase boot time quite a bit about 2 seconds.