Keyboard shortcuts in HTML using javascript

Keyboard shortcuts are the most easiest way to operate computer. Can you use the Keyboard shortcuts in HTML ? Yes. you can use Keyboard shortcuts in HTML using javascript. Here is simple javascript library that lets you to use keyboard shortcuts in your website.

Download the Mousetrap library from official website

Currently, Mousetrap supported following keys:

shift, ctrl, alt, backspace, tab, enter, return, capslock, esc, escape, space, pageup, pagedown, end, home, left, up, right, down, ins, del,

Following events are supported by Mousetrap:

  • Mousetrap.bind
  • Mousetrap.unbind
  • Mousetrap.trigger
  • Mousetrap.stopCallback
  • Mousetrap.reset
  • Mousetrap.handleKey