Due to some circumstances, this blog is now up for sale, for more enquires contact: Plushista@gmail.com
Pin It

20 JavaScript Libraries to Handle Keyboard Events

by Durodola Ridwan | Saturday, February 08, 2014 | 8 Comments

Keyboard Event’s can add further usability to websites that have high interactivity with the user or need input via the keyboard as key combinations that trigger events on the page. They could also be useful to provide quick shortcuts or for keypad entry.

Incorporating event handlers to your HTML documents and registering functions via JavaScript is another great way to make your web applications react similarly to a desktop application. The following JavaScript libraries we have collected will enable you in creating a variety of keyboard event handlers.


Keypress is an input capture library with some very special features, it is easy to pick up and use, has a reasonable footprint (~9kb), and has no dependencies. This library have been tested with all major browsers and operating systems, but have not been thoroughly tested in non-English keyboards.


Mousetrap is a standalone library with no external dependencies. It weighs in at around 1.9kb minified and gzipped and 3.5kb minified. To use any of Mousetrap  extensions all you have to do is include the javascript on your page after you include Mousetrap.
Mousetrap has been tested and should work in Internet Explorer 6+, Safari, Firefox and Chrome.

jQuery Hotkeys
jQuery Hotkeys is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. It is known to be working with all the major browsers on all available platforms (Win/Mac/Linux): IE 6/7/8, FF 1.5/2/3, Opera-9, Safari-3 and Chrome-0.2.


Keymage is a small library for handling key bindings in JavaScript. It was written out of the fact that no other library supported combination of all necessary features and their design made it easier to write a new one.


KeyboardJS is a JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts. It can be used as both a standalone library or an AMD module. The library has support for both single + combo strokes and can work with keyboards of any locale.


kbNav can easily make any website completely navigable by keyboard in an intuitive and user-friendly way. kbNav shortcuts appear on the objects you're clicking. You can easily find the shortcut you need. You'll develop an unconscious association between the shortcut and the action while using the site, eliminating the need for memorization.
kbNav shortcuts are activated simply by pressing keys and then hitting enter. Shortcuts can consist of multiple letters/numbers, so every action can have a shortcut.


Keymaster is a simple micro-library for defining and dispatching keyboard shortcuts in web applications. Keymaster has no dependencies and can be used completely standalone. It should not interfere with any JavaScript libraries or frameworks.
Keymaster should work with any browser that fires keyup and keydown events, and is tested with IE (6+), Safari, Firefox and Chrome.


jwerty is a JS lib which allows you to bind, fire and assert key combination strings against elements and events. It normalises the poor std api into something easy to use and clear. It weighs around 1.5kb bytes minified and gzipped (~3kb minified) and has no dependencies, but is compatible with jQuery, Zepto or Ender if you include those packages alongside it. 


This is a library for normalizing JavaScript key codes across browsers. This library works with key objects, which are { Int code, bool shift, bool alt, bool ctrl } JavaScript objects that record the key code along with any modifiers pressed. translate_event() returns one of these; hot_key() takes one of these and returns a string suitable for the JQuery HotKey plugin or Binny V A's shortcut.js library.

Handling Keyboard Shortcuts in JavaScript

With this library, you can add keyboard shortcuts to your JavaScript app. It support Meta Key for Mac, and beware that it's beta - so expect some problems.


keyboard.backbone.js depends on domEvents.backbone.js, which in turn depends on jQuery and Backbone. There's no particular reason for the dependency on domEvents, apart from the fact that keyboard.backbone.js only binds on keyDown and keyUp (well, key:down and key:up), so if you want to take a different action on key:press, you're going to need a different library for it.


Kibo is a simple JavaScript library for handling keyboard events. Kibo has no dependencies and it's released under the MIT License.

JavaScript Shortcuts Library

This is an impressive, yet easy-to-use JavaScript shortcut library for handling keyboard events.

User Keyboard Shortcuts

UserKeyboardShortcuts is a refactor of the Keyboard class provided by mootools-more. It makes it easy for you to provide local user-customizable keyboard shortcuts for your users that you don't have to care about.

You just use Keyboard.addShortcuts (provided by Keyboard.Extras) as you usually would, then the user can change the keys to their liking. The assignments they make will be stored using localStorage (failing that a cookie) and will be restored on each subsequent page load.


The two methods jQuery.shortcut.add and jQuery.shortcut.remove are used to add and remove key bindings, respectively. Both take a key-combination and a callback. jQuery.shortcut.add can optionally receive an options hash.

jQuery Beeline

Beeline means take the most direct route. It's keyboard navigation for web applications, and it's base upon jQuery Hotkeys.

jQuery Shortcuts

jQuery Shortcuts is a very lightweight approach to keyboard shortcuts (hotkeys) with jQuery, and it's licensed under the MIT and GPL licenses.


A simple example of key boards shortcuts implementation with JavaScript. It has no intention to be a complex implementation of binding JavaScript events. All the actions after the bind keys recognized, stay with the programmer creativity.


jKey is another useful JavaScript shortcut library for handling keyboard events. It works with jQuery, so you can select any applicable element to set a key command to. Basically, any element that can be focused on such as an input or textarea can have a key command applied to it.


Keys.js is a great keybindings for browser applications. It serialize bindings for persistance using localStorage, or uploading to a server for personalized keybindings in your web application. Deserialize them easily using the same API.
Key.js has CommonJS and AMD module support, and can be used with require.js or another module loader, and it has been tested on browsers like: IE7+, Firefox 21+, Safari 6+ and Chrome 27+.

Go Social:

Subscribe For Free Updates!

*Please confirm the email sent to your inbox after clicking "Sign Up!".

8 comments : Post Yours! Read Comment Policy ▼
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.

  1. I still can't get over this great place I recently visited! A dancefloor, two bars (one by the entrance and a smaller one on the other end of the floor.
    Wedding venues in San Diego

  2. Wow. This really made my day. Thanks a lot!

    Javascript Training in Chennai | HTML5 Training in Chennai

    JavaScript Training Courses | Javascript Online Training | Angular 2 Training in Chennai

    JavaScript Training in Chennai

    JS Training in Chennai

    AngularJS Training in CHennai

    HTML5 Training in CHennai

    Training in CHennai

  3. iPhone have a line of smartphones designed and marketed by Apple Inc.They run Apple's iOS mobile operating system.The most recent iPhone model is the iPhone 7,Now to use Iphone 7 without any Problem and restrictions imposed by Iphone's IOS.
    You can Download iPhone 7 Jailbreak from CydiaNerd.


About Me

My Photo
Durodola Ridwan is a Professional blogger, SEO Consultant, Certified Web developer/designer and founder of www.realcombiz.com. He love writing about Blogging tips, SEO, and play around with codes. You can connect with him on facebook, twitter @realcombiz, and Google+.

Recent Posts

Let's Connect

Site Links

Copyright © 2014 RealcomBiz. All Rights Reserved.
Powered by Blogger