dmauro/Keypress

Azerty support

Opened this issue · 2 comments

Is it in roadmap ?

No. I'm not very focused on this right now because I've been pretty happy about where it's at. But if someone wants to write support to offer custom keyboard mappings, I'd love to review and merge it in :)

Just an idea, but even though there is still no support for event.key on Safari (although hopefully coming soon), we might be able to use that instead of event.keyCode to detect some keys. For instance, the -/6 azerty key generates an event with the same keyCode (which is the same as the 6/^ qwerty key), but a different key property, depending on whether shift was pressed. In other words, do not use the code of the key (which might match a different character depending on the keyboard layout), but the character itself.

It should still work the old way when event.key is not supported though, for older browsers (and Safari).

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

https://bugs.webkit.org/show_bug.cgi?id=69029

If that sounds like a good idea to you @dmauro, I might try to implement it soon.

Edit: FYI, I kinda need that feature, as I wish to be able to use - as a shortcut in my app.