JavaScript Library For Custom Keyboard Shortcuts – hot-key-lib

Category: Javascript , Others | August 22, 2016
Author: Web-Engine
Views Total: 643
Official Page: Go to website
Last Update: August 22, 2016
License: MIT

Preview:

JavaScript Library For Custom Keyboard Shortcuts – hot-key-lib

Description:

hot-key-lib is a pure JavaScript library which allows you to bind any custom keyboard shortcuts for your web applications.

How to use it:

Include the JavaScript file hot-key-lib.js on the webpage.

<script src="hot-key-lib.js"></script>

Initialize the HotKey and we’re ready to go.

var hotKey = new HotKey();

Add a custom keyboard shortcut as this:

hotKey.add("CTRL+A", function (e) {
  // ...
});

Prevent default behavior from browser.

hotKey.setup({
  "preventDefault": true
});

Start the HotKey. That’s it.

hotKey.start();