-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Overriding browser shortcuts? #40
Comments
I thought about implementing the method, but I realized the part. Press ctrl + r to prevent the browser from refreshing and performing other operations. But ctrl + t does not work. You can try switching to another combined shortcut. |
Similarly, on a Mac, command-option-left-arrow and command-option-right-arrow don't work. I think those events are handled at a very low level, javascript doesn't see them, and can't preventDefault(). I'm not aware of any away around that, but wish for one. |
@davemerrill The command + option + left shortcut is occupied by the browser. |
I would like to override |
example: https://codepen.io/jaywcjlove/pen/pooQVEr?editors=1010 hotkeys('command+p,ctrl+p', function(event,handler) {
event.preventDefault();
console.log('handle', handler.key, event)
}); |
@jaywcjlove thanks. It works. I use |
This does not work for |
some shortcuts can't be overriden: I came across the same problem we just have to live with it. |
Thank you for creating this library, it's extremely easy to use and very helpful!
I wanted to set a shortcut to 'ctrl+t', but when I tested it in Chrome, it opened a new tab instead.
Is there any way to override browser shortcuts?
If not, is there a list of all browser shortcuts across all browsers, so I can know which shortcuts aren't already being used by one or more browsers?
The text was updated successfully, but these errors were encountered: