pop-os / keyboard-configurator

Keyboard configuration UI
GNU General Public License v3.0
259 stars 45 forks source link

chore: Deduplicate `layouts/` and improve layout generation #208

Closed ids1024 closed 11 months ago

ids1024 commented 12 months ago

Instead of having a keymap.json per "keyboard", and an overrides directory with variants of each, there are now 3 keymap json files: ec, qmk, and qmk_legacy.

This has always been a bit redundant, but overrides made it worse, so this is an improvement. This moves filtering out of LED keycodes depending on the board to backend, instead of layouts.py.

led.json generation still needs to be updated for the new version of QMK.

ids1024 commented 11 months ago

Oh, I guess one effect of this is to add Pause/Break to the keymap.json for all keyboards. Which I had been avoiding updating since it wouldn't work on older firmware.

Looking at changelog.json files in firmware, most models have EC firmware new enough to support it, if updated, but some are still older than https://github.com/system76/ec/commit/158ec124fe600fab0e80d41fc5cab1048a4ececa.

Maybe, as I suggested before, it would be best to add logic here to enable the keycode based on the ec firmware build date. No obviously better way to do this.

ids1024 commented 11 months ago

Okay, now this makes PAUSE available and uses it in the default layout depending on EC build date. A bit awkward, but I think this should be the best way to get correct behavior across models. Especially if some don't have released firmware with the feature.

This also regenerates default layouts to use PAUSE and SCROLL_LOCK (as was done it later EC versions). So now layouts/ exactly matches what is generated with layouts.py.

So this should now fix https://github.com/pop-os/keyboard-configurator/issues/140 and https://github.com/pop-os/keyboard-configurator/issues/176.

ids1024 commented 11 months ago

Actually, there are a couple failing tests to address here...