Easily add combination key-press event listeners in JavaScript. Useful for adding keyboard shortcuts to web applications.
Here's the original version. I'm putting this up on GitHub to make loading this using Bower a bit easier.
Basic Version
shortcut.add("Ctrl+B", function () {
window.alert("Make it Bold!");
});
AngularJS
app.controller('yourCtrl', function(jsShortcuts) {
jsShortcuts.add("Ctrl+B", function () {
window.alert("Make it Bold!");
});
});
More information available on the original doc page.
Install via bower:
bower install js-shortcuts --save
and require the script:
<script src="bower_components/js-shortcuts/js-shortcuts.js"></script>
Install via bower as above. Use the AngularJS version of the script.
<script src="bower_components/js-shortcuts/js-shortcuts-angular.js"></script>
Add the module js-shortcuts
as a dependency to your app
var app = angular.module('yourAwesomeApp', ['js-shortcuts']);
BSD License