We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like event bound to a key is also triggered if the key is pressed with a command modifier. I am using the following test HTML file:
<html> <script src="mousetrap.js"></script> <script type="text/javascript"> Mousetrap.bind('l', function() { console.log('l pressed'); }); </script> </html>
And I see the console message even when I hit "Command-l" rather than "l".
The text was updated successfully, but these errors were encountered:
This is interesting. I can look more into it later, but in the mean time if you change it to a keydown event it should work as expected.
keydown
Mousetrap.bind('l', function() { console.log('l pressed'); }, 'keydown');
FireFox actually seems to behave the same way as Safari where as Chrome will not fire a keypress event if there is a meta modifier.
keypress
meta
I will fix this in Mousetrap though to make it work as expected cross-browser so thanks for the report!
Sorry, something went wrong.
I like your comment.
b616280
Updated mousetrap to newest version
3f93aaa
This removes need for my fix in keyboard.js: ccampbell/mousetrap#53
No branches or pull requests
It looks like event bound to a key is also triggered if the key is pressed with a command modifier.
I am using the following test HTML file:
And I see the console message even when I hit "Command-l" rather than "l".
The text was updated successfully, but these errors were encountered: