Mousetrap – excellent keyboard shortcuts

Just discovered a great little library called mousetrap.

It enables you to have complex, chained if required, keyboard events bound in a very simple, powerful way with no reliance on an underlying library.

Example usage:

Mousetrap.bind('d', function() {;

Mousetrap.bind('a', function() {

Mousetrap.bind('x', function() {

Mousetrap.bind(['command+a', 'ctrl+a'], function() {

Find out more, test and download it here, or access the git repository here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.