JavaScript keyboard HTML CSS keyboard-shortcuts mousetrap
Need help with mousetrap?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.


Simple library for handling keyboard shortcuts in Javascript

10.4K Stars 933 Forks Apache License 2.0 392 Commits 232 Opened issues

Services available

Need anything else?



Mousetrap is a simple library for handling keyboard shortcuts in Javascript.

It is licensed under the Apache 2.0 license.

It is around 2kb minified and gzipped and 4.5kb minified, has no external dependencies, and has been tested in the following browsers:

  • Internet Explorer 6+
  • Safari
  • Firefox
  • Chrome

It has support for

, and
events on specific keys, keyboard combinations, or key sequences.

Getting started

  1. Include mousetrap on your page before the closing


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.