Fix keyboard mappings for international keyboard layouts
Key presses by a client with an international keyboard layout will often fail.
I.e. the key AltGr creates an error message "No mapping for key 255". This key is important to produce the @ symbol i.e. on German language keyboard. The currently used e.keyCode
differs by browser vendor and is ambiguous for some keys.
This change relies instead on the event.code
, which is stable for most common keys and more complete.
I keep the old implementation to rely on e.keyCode
as a fallback if the e.code
is not available or the mapping for it is missing.