A keyboard shortcut library, shortcut.js listens for common keyboard shortcuts and triggers custom events for you to use.
Shortcut | Event Name |
---|
j | shortcutNextItem
k | shortcutPrevItem
n | shortcutNewItem
o | shortcutOpenItem
/ | shortcutSearchItems
. | shortcutLoadItems
? | shortcutShowHelp
document.addEventListener('shortcutNextItem', function() {
// your code here
});
With bower
bower install shortcutjs
Or, just stick shortcut.js or shortcut.min.js in your project
Please review our contributing guidelines here
Most of the big web applications ( Facebook, Twitter ) have a handy set of keyboard shortcuts but there is no standardization amongst these sites. A shared library such as shortcut.js could help web applications share a common set of keyboard shortcuts.