Add KLE json output to qmk info command, plus a few other enhancements #25903
+311
−24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With more use of data-driven configuration,
qmk infois becoming a more useful tool.This change improves it in a few ways:
qmk infocan now optionally output information in KLE json format (use-f kle). This allows QMK layouts and keymaps to easily be imported into KLE, to create pretty renderings that are driven by the actual QMK key bindingsqmk infonow uses the QMK keycode database (.../data/constants/keycodes)to source human readable key names.qmk infonow uses Unicode and some simple heuristics to create shorter labels for some commonly used key bindings, making them fit better into the rendered output.Here are some examples:
qmk info -f kle -kb wuque/ikki68_aurora -km spidey3 > ~/tmp/ikki.jsonqmk info -f kle -kb wuque/ikki68_aurora -km spidey3 -m > ~/tmp/ikki_full.jsonCaveats
keyboard.jsonandkeymap.json. If you don't have key location information, or that information is incorrect, then the output is going to be equally incorrect.qmk info -f kleoutput is loaded into KLE. I suspect that this is a combination of some inconsistent behavior in KLE, and possibly, an issue inqmk kle2jsonwhen used to convert KLE output json to QMK. Note the impact of this is low; at present there are only 14 keyboards in the repo that specify rotation.-f kle, the vertical spacing can be incorrect (especially if there are rotated clusters). The problem is that while most things in KLE json are relative positions, rotation origin x/y are absolute locations.Types of Changes
Checklist