
Yet another JavaScript library to handle keyboard shortcuts that let you create events triggered by custom keyboard combinations.
Supported modifier keys:
- CMD (Mac)
- Ctrl
- Alt
- Shift
How to use it:
Insert the ‘shortcuts.js’ into the document and we’re ready to go.
<script src="shortcuts.js"></script>
Bind custom keyboard shortcuts and key presses as these:
shortcuts.add('shift+up',function() {
alert('You pressed shift+up')
})
shortcuts.add('ctrl+5',function() {
document.body.style.background = "#ffff00";
})
shortcuts.add('alt+k',function() {
document.getElementById("foobar").innerText = "Hello there Earthling!";
})






