Use `keyCode` instead of `key` for keyup/keydown events
freddyb opened this issue · 1 comments
Hey,
Aside: first of all, huge kudos for pulling this off. I have especially enjoyed the technical write-up. For context: I know how to play a keyboard but have never used a synthesizer user so I'm still fooling around.
I noticed that your MidiKeyboard implementation is based upon a keyMap using letters to identify keys on the keyboard.
While this works well on a US keyboard, it is a bit cumbersome on others. E.g., on a German keyboard, the letters "z" and "y" are swapped and playing notes would involve a some odd finger gymnastics :)
A possible solution is to use the key's code
as they translate roughly to button-positions on the keyboard rather than what is actually printed on the keycap.
Thanks!
Hey, tyvm for trying the synth and opening this issue!
I 100% agree key codes is a much better way to handle this, and I'll get this implemented.