Questions tagged [mousetrap]

Mousetrap is a JavaScript library for handling keyboard shortcuts

Official Links

36 questions
1
vote
1 answer

Mousetrap firing twice

This is my code: Mousetrap.bind('l', (e) => { console.log('l') }) Mousetrap.bind('k+l', (e) => { console.log('k+l') }) I have 2 questions: 1. When I press l I'm seeing both logs. Any ideas why? 2. When I'm pressing k + l, I'm seeing both logs…
Mati Tucci
  • 2,826
  • 5
  • 28
  • 40
1
vote
1 answer

Curious to know why my Createjs with Mousetrap is going slow. (jsfiddle provided)

I'm working with the new createjs, and they've removed flip and addflipframes. Apparently scaleX=-1 is suppose to be faster but now I get a weird lag when I want to move my character left and right. I'm just hoping that I've coded my movement…
jemiloii
  • 24,594
  • 7
  • 54
  • 83
1
vote
1 answer

MouseTrap lost focus in modal popUp

I have a web application that uses a mousetrap API for keyboard shortcuts. I am facing difficulties in the following scenario: I'm in a modal (jQueryUI) and this modal having a second modal alert. When the alert is closed, the focus does not return…
1
vote
2 answers

Making Mousetrap click a link

If I have a link and want to bind a keyboard shortcut to, how should I do that? This doesn't seem to work: