ijprest / kle-serial

Serialization library for keyboard-layout-editor.com
http://www.keyboard-layout-editor.com/
MIT License
76 stars 27 forks source link

Fix issue with incorrect x and y for rotated key #1

Open kevin-wells opened 5 years ago

kevin-wells commented 5 years ago

kle-serial behaves differently to keyboard-layout-editor for rotated keys, for example the E key in the default Atreus layout.

Changed include a test to replicate the problem, and a fix which does the same thing as keyboard-layout-editor.

I also added es5 and es6 to libraries because otherwise npm run build would not work for me.

chr11031 commented 2 years ago

@kevin-wells I have a differently coded fix for this. Would your PR benefit from any of my code? https://github.com/ijprest/kle-serial/compare/master...chr11031:chr11031_rotation_x_y_hotfix?expand=1

kevin-wells commented 2 years ago

@chr11031 Is this fixing a bug e.g. a layout that works with keyboard-layout-editor but not kle-serial? I've been treating https://github.com/ijprest/keyboard-layout-editor/blob/master/serial.js as the specification.

chr11031 commented 2 years ago

@kevin-wells That is correct. In rendering KLE data parsed from KLE-Serial I found these changes necessary to address the rotation issues I believe your PR/Issue is covering.

I saw that you might be working on something similar to my challenge so I'm sharing these changes with you. I shared it in the hope that maybe it would prove useful to you. If I'm misreading things though or it is not relevant to your interests, no loss in ignoring my contribution.

haversnail commented 1 year ago

@ijprest is this something we can get merged and published to npm? Came across this issue as well with an Alice layout.

Also tested the change and it works for my case as well, FWIW. 👍