mousetrap icon indicating copy to clipboard operation
mousetrap copied to clipboard

boolean test of a previous binding

Open atojs opened this issue 11 years ago • 8 comments

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.

atojs avatar Mar 31 '13 15:03 atojs

Do you mean you are looking for a function where you can do Mousetrap.isBound('ctrl+s') to check if that combination is bound?

ccampbell avatar Mar 31 '13 16:03 ccampbell

precisely.

atojs avatar Mar 31 '13 17:03 atojs

+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.

usmonster avatar Dec 06 '13 16:12 usmonster

(See also #59.)

usmonster avatar Dec 06 '13 20:12 usmonster

+1

jg avatar Mar 17 '15 08:03 jg

+1

lifeinchords avatar Jun 09 '15 10:06 lifeinchords

+1

huang-yuwei avatar Jun 28 '19 02:06 huang-yuwei

+1

boltcoder avatar Oct 07 '20 10:10 boltcoder