mousetrap
mousetrap copied to clipboard
boolean test of a previous binding
Instead of the second bind combo overwriting the first, may we have a top-level function that will return a true/false for a given combo?
I am using mousetrap in a dynamic environment where I would like to offer the user a choice case they chose a binding another component has already claimed. with this, I can test/ask/rebind.
Do you mean you are looking for a function where you can do Mousetrap.isBound('ctrl+s')
to check if that combination is bound?
precisely.
+1 for this or similar. Maybe even just a getBindings(shortcut)
to return the callback(s) or an object mapping of shortcuts to callbacks when no argument is given.
(See also #59.)
+1
+1
+1
+1