
keylani.js is a small JavaScript library to bind and map keyboard shortcuts and key presses in a simple way.
How to use it:
Download and import the keylani.js library from the dist folder.
<script src="/dist/umd/keylani.min.js"></script>
Show keyboard shortcuts on an element (OPTIONAL).
<button data-keybind="t+1" data-keyshow="true">T & 1</button>
Bind keyboard shortcuts and execute callbacks when the keys are pressed.
Keylani.bind('Control + c', (pressed) => {
// do something
});Bind an object of keyboard shortcuts.
Keylani.map({
'a': (pressed) => { // do something },
'Ctrl + a': (pressed) => { // do something },
...
});Run all keyboard bindings when you click a trigger element.
Keylani
.when('click', document.getElementById('clickhere'))
.run({
// do something
});






