-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows keydown
with shift
triggers with the uppercase key
#621
Comments
It seems like these lines are trying to do something similar, but it probably doesn't get to it because |
i hit this as well with |
@tehhowch @swastik Thanks for your bug report and the follow up. This definitely sounds like something we should improve. This test file is a bit complex but it would be the one to try to add a a failing test to: https://github.com/adopted-ember-addons/ember-keyboard/blob/master/test-app/tests/unit/utils/is-key-test.js If anyone wants to try their hand at a PR, I am happy to review and offer guidance. Feel free to hit me up on Discord if you'd like to discuss as you dive in. |
I'm having similar issues with cross-platform and keyboard layout compatibilty. Attempt to register Attempt instead to use The only reliable way seems to be the ascii code |
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 on Mac, the keydown event is triggered with lowercase
g
:On Windows,
keydown
is triggered with uppercaseG
:Anything with
shift
seems to trigger with its uppercase variation. I'm assuming the shortcut isn't triggered because of that. I cannot usecode
because that doesn't seem to work with different keyboard layouts.Questions:
cmd+shift+g
andcmd+shift+G
) seems to work, but it also feels like I'm doing the wrong thing!I'd appreciate any thoughts—thank you!
The text was updated successfully, but these errors were encountered: