Minimalist Keypress Event Binding Plugin For jQuery - keyby

File Size: 4.16 KB
Views Total: 762
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Minimalist Keypress Event Binding Plugin For jQuery - keyby

Yet another jQuery keyboard shortcut binding plugin which allows to bind an event handler to any key presses you specify. Useful in some cases when you want to perform an action by pressing on a specific key. Supports both modifier and special keys.

How to use it:

1. Just include the JavaScript file keyby.js after jQuery library and the Keyby plugin is ready for use.

<script src="//code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script src="js/keyby.js"></script>

2. The JavaScript to trigger a function when you press on the 'J'.

keyby.on('j', function(){
 alert('You just pressed on j');
})

This awesome jQuery plugin is developed by sideris. For more Advanced Usages, please check the demo page or visit the official website.