keyboard-layout-editor
keyboard-layout-editor copied to clipboard
Snap-to-grid feature to prevent and/or fix rounding issues
When setting stepsize to 0,125 system wound round it all up, so after a few moves, it gets extra +0.01 So its imposible to return key moved with 0,125 steps to its original position.
So one move to the left, and back - will give 14,01 after original 14
I have similar issues, it pops up worse when using angled keys. I think if you modify some settings in the JavaScript (there's a min step size or somesuch) you will have better control. When I initially added code for setting the step size I let it go down to 0.01 but IJP changed it to 0.05 for some reason, guess he thought that was small enough.
Floating-point math is hard. There's probably no way to guarantee numbers don't 'drift' occasionally.
I think what we really need is a snap-to-grid feature, which would allow you to quickly snap keys back to a defined grid. I'll rename this issue accordingly.