To use:
After installation, include the javascript file, in node use:
const keybinder = require("keybinder");
Or in html include using script tag:
<script src="path/to/keybinder.min.js"></script>
You can go ahead and use keybinder in below format:
keybinder(selector, keys, callback);
argument | type | definition |
---|---|---|
selector | string | HTML tag, class or id name of element to bind keys to. |
keys | array | Array of key combinations to listen to. |
callback | function | Callback function to trigger if key combinations specified are pressed. This is automatically bound to the element specified as selector. |
Working example: