-
Notifications
You must be signed in to change notification settings - Fork 967
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
Fail to unbind global shortcut #306
Comments
Indeed, I tried it too in jsfiddle and I wasn't able to unbind it. What I could do to temporary solve is to bind it again with empty function callback. Mousetrap.bindGlobal('ctrl+s', function() { alert("Hi!"); }); |
I have run into the same issue when using bindGlobal and then later needing to clear everything with Mousetrap.reset(). My keyboard shortcuts are built dynamically based on server response, is there a way to get all the current Mousetrap bindings programmatically in order to assign them empty functions? |
+1 for this. I want |
+1. A use case for this is to have global shortcuts for different pages in an app. It must be possible to unbind them. Also I think It is programmer friendlier to have the methods in pairs bind/unbind bindGlobal/unbindGlobal (I expected this behaviour and it didn't work 😅). We are currently using #353 in some apps. Seems to be working as expected. |
Hi, how do I unbind global shortcut?
I did the following:
Mousetrap.bindGlobal('ctrl+s', function() {
alert("Hi!");
});
....
Mousetrap.unbind('ctrl+s');
However when pressing ctrl+s I still get the Hi! message.
Thanks!
The text was updated successfully, but these errors were encountered: