In Atom, we use a keydown event handler to match sequences of keystrokes against key bindings. The problem is that on international keyboard layouts, we have a really hard time mapping these events to user intents for characters that require modifiers.
For example, on a German keyboard, `AltGr-Q` is used to insert an `@` character. However, the `keyIdentifier` and `code` properties don't indicate the `@` character and instead report `Q` as having been pressed.
From my understanding of the spec, it seems like the `KeyboardEvent.key` property could be our solution here. It would apply any modifiers that actually influence the printable character up-front based on the configured layout, making it much easier for us to match events to key bindings in a universal way.
1) Am I correct that this is the feature we're looking for?
2) If so, can I chirp for a worm here, and talk anyone on the Chrome team into proceeding with an implementation?
Thanks for your time!
Argh, posted on my personal account. Subscribing with my GitHub account.
Seq No. | Event Type | keyCode (e.key) | keyCode (e.keyCode) | Code (e.code) | charCode (e.charCode) | location | Alt | AltGraph | Caps Lock | Control | Fn | Meta | NumLock | Scroll | Shift | SymbolLock | OS | keyIdentifier |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | keydown | AltGraph | 225 | AltRight | 0 | 2 | false | false | false | false | false | false | true | false | false | false | false | U+00E1 |
5 | keydown | @ | 81 | KeyQ | 0 | 0 | false | true | false | false | false | false | true | false | false | false | false | U+0051 |
6 | keypress | @ | 64 | KeyQ | 64 | 0 | false | true | false | false | false | false | true | false | false | false | false | U+0040 |
7 | keyup | @ | 81 | KeyQ | 0 | 0 | false | true | false | false | false | false | true | false | false | false | false | U+0051 |
8 | keyup | AltGraph | 225 | AltRight | 0 | 2 | false | true | false | false | false | false | true | false | false | false | false | U+00E1 |
--
You received this message because you are subscribed to the Google Groups "input-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+...@chromium.org.