keymap-editor
keymap-editor copied to clipboard
Look into key positioning code
Applying rotations to keys can be hard to get right, especially when trying to make a symmetric layout.
Two things that make this troublesome:
- the default origin for a key is its top-left corner; not a problem for the most part but once you get into rotations things will start to feel unpredictable
- to make things harder, the transformations around custom key sizes sort of depends on that origin
- the calculations are done based on a known "1u" size for a key, but they also have to contend with the margin I've thrown into the mix. I think technically the "1u" spacing should be the distance from one switch to the next and whatever margin there is after that is a product of keycap dimensions
Some changes are needed, but they could break existing layouts. The good news is that 1u-based layouts with no rotated keys should be unaffected, because regardless of individual key placement the entire layout is positioned according to its bounding box. Still, maybe there should be a way to detect this and gracefully fallback to the old functionality.