mousetrap icon indicating copy to clipboard operation
mousetrap copied to clipboard

Shortcuts with 2 keys block shortcuts with three

Open kvendrik opened this issue 7 years ago • 4 comments

Say you have a shortcut for g s and one for g s p. g s p won't work as the library triggers the callback as soon as it gets to g s and then resets. I tested this with the latest version (1.6.0) and tried older versions down to 1.4.2 but the result was the same.

http://codepen.io/anon/pen/rrmyAY?editors=0010

kvendrik avatar Sep 26 '16 16:09 kvendrik

I resolved this issue by going the keyCode route with vanilla JS. Would be helpful if someone could update the code to prevent the issue you stated...

juanparadox avatar Mar 09 '17 15:03 juanparadox

@juanparadox you might wanna check out https://github.com/shopify/hotshot to use until Mousetrap has implemented a fix.

kvendrik avatar Mar 09 '17 18:03 kvendrik

@juanparadox could you specify in code how you resolve this issue? Maybe a demo. Thanks in advance

ntoscomeli avatar Jan 08 '20 13:01 ntoscomeli

@ntoscomeli I basically just captured the keystrokes using key event listeners and debouncing the clicks. Unfortunately, I don't have a demo and apologies for replying so late.

juanparadox avatar May 05 '20 00:05 juanparadox