Open Ponali opened 5 months ago
it tries to get a QWERTY-reliant value, which doesn't happen with "key" and the deprecated "keyCode".
v86 uses event.code, that uses standard QWERTY physical keys layout and not depends by host keyboard layout (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code#handle_keyboard_events_in_a_game), and convert to BIOS key codes. https://github.com/copy/v86/blob/c69cbd7854d7cbda08679c389973aa87c9fb37bd/src/browser/keyboard.js#L316 https://github.com/copy/v86/blob/c69cbd7854d7cbda08679c389973aa87c9fb37bd/src/browser/keyboard.js#L122-L126
Workaround is setting on guest OS needed for you layout (for example, via loadkeys
, demo: https://copy.sh/v86?profile=archlinux&c=loadkeys%20fr)
hi, my keyboard is in AZERTY, which is the normal type of keyboard for my country, but that causes some problems with input. keys like "," turn into "m" and vice-versa, "a" turns into "q" and vice-versa. with my DOM JS experience, this could be an issue with the keyboard script(s) because it tries to get a QWERTY-reliant value, which doesn't happen with "key" and the deprecated "keyCode". this is just some of my speculation however.