Skip to content
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

[BUG] callback gets call incorrectly with incorrect key #158

Open
aprilmintacpineda opened this issue Jul 17, 2020 · 0 comments
Open

[BUG] callback gets call incorrectly with incorrect key #158

aprilmintacpineda opened this issue Jul 17, 2020 · 0 comments
Assignees

Comments

@aprilmintacpineda
Copy link

Describe the bug

The callback gets called incorrectly on mac.

Example code

keyboardJS.bind('c', () => console.log('c called!'));
  • When I press c, it gets called, which is correct.
  • When I press shift + c, it gets called, which is incorrect.
  • When I press command + c, it gets called, which is incorrect.

Here: https://jsfiddle.net/p7Lbz9uh/

Expected behavior

  • When I press shift + c, the callback should not be called.
  • When I press command + c, the callback should not be called.

Enviroment (please include the following info):

  • OS: macOS
  • Browser: Chrome@latest
  • Version: Not sure what to put here.

Additional context

When I do:

keyboardJS.bind('c', () => console.log('c got called!'));
keyboardJS.bind('command + c', () => console.log('command + c got called!'));

The correct callback gets called, but shift + c will still say c got called!, but when I do:

keyboardJS.bind('c', () => console.log('c got called!'));
keyboardJS.bind('command + c', () => console.log('command + c got called!'));
keyboardJS.bind('shift + c', () => console.log('shift + c got called!'));

The bug is not existent. https://jsfiddle.net/p7Lbz9uh/1/

@aprilmintacpineda aprilmintacpineda changed the title callback gets call incorrectly with incorrect key [BUG] callback gets call incorrectly with incorrect key Jul 20, 2020
@RobertWHurst RobertWHurst self-assigned this Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants