Handling Keyboard Events With JavaScript – jwerty.js

Category: Javascript , Others , Recommended | September 2, 2017
Author: keithamus
Views Total: 1,540
Official Page: Go to website
Last Update: September 2, 2017
License: MIT

Preview:

Handling Keyboard Events With JavaScript – jwerty.js

Description:

jwerty.js is a dependency-free JavaScript library to handling keyboard events that allow to creates custom events triggered by keyboard combinations.

Basic usage:

Insert the main JavaScript file jwerty.js just before the closing body tag.

<script src="jwerty.js"></script>

Bind your callback function to a keyboard combination.

jwerty.key('ctrl+alt+A', function () { 
  // do something 
});

It also supports key key sequences separated by commas.

jwerty.key('↑,↑,↓,↓,←,→,←,→,B,A,↩', function () { 
  // do something 
});

REGX is supported as well.

jwerty.key('ctrl+[a-c]', function () { 
  // do something 
});

You Might Be Interested In:


Leave a Reply