adopted-ember-addons / adopted-ember-addons/ember-keyboard
Windows `keydown` with `shift` triggers with the uppercase key
- Lingua principale
- JavaScript
- Stelle
- 177
- Fork
- 59
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hey there! Thanks for this great addon! 😄
I'm trying to add a keyboard shortcut in my app, something like `cmd+shift+g`. I'm registering it like `{{on-key "cmd+shift+g" this.doSomething}}`. It seems to work on Mac, however on Windows the shortcut is never triggered.
Looking at [javascript.info](https://javascript.info/keyboard-events) on Mac, the keydown event is triggered with lowercase `g`:

On Windows, `keydown` is triggered with uppercase `G`:

Anything with `shift` seems to trigger with its uppercase variation. I'm assuming the shortcut isn't triggered because of that. I cannot use `code` because that doesn't seem to work with different keyboard layouts.
----
Questions:
1. Is this known? Are there any known workarounds for this?
2. Is this something that should be handled within the library? For now, registering all variations of the shortcut (i.e. both `cmd+shift+g` and `cmd+shift+G`) seems to work, but it also feels like I'm doing the wrong thing!
I'd appreciate any thoughts—thank you!
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.