Search

7/16/2013

Create Keyboard Shortcuts with Mousetrap

Create Keyboard Shortcuts with Mousetrap

Mousetrap.bind("d a v i d", function() {
 // Alert "FTW"
});

// konami code!
Mousetrap.bind('up up down down left right left right b a enter', function() {
    highlight([21, 22, 23]);
});

Mousetrap.bind("shift+k", function() {
 // Yay for extra key control
});

沒有留言: