dmauro / Keypress

A keyboard input capturing utility in which any key can be a modifier key.
http://dmauro.github.io/Keypress/
Apache License 2.0
3.18k stars 313 forks source link

Azerty support #109

Open vogloblinsky opened 8 years ago

vogloblinsky commented 8 years ago

Is it in roadmap ?

dmauro commented 8 years ago

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 :)

jlowcs commented 8 years ago

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.