10 Best JavaScript Libraries To Create Custom Keyboard Shortcuts
When you're building an accessible web app, it is critical to implement Keyboard Accessibility to ensure that your users have access to information without using a mouse.
The easiest way to implement Keyboard Accessibility on a website is to use a JavaScript keyboard shortcut library, which enables you to bind keyboard shortcuts and key presses to common actions like Navigate between pages, Like/Dislike posts, Rate products, etc.
In this blog post, you will find the 10 best (most downloaded in a year) jQuery plugins and Vanilla JavaScript libraries that make it easy to trigger any actions on the page by keyboard combinations or keypresses.
Originally Published Dec 23 2020, updated May 18 2023
Table Of Contents:
jQuery Keyboard Shortcut Plugins
Add Custom Keyboard Shortcuts To Webpage - keymap.js
A simple yet powerful jQuery plugin for capturing keyboard events and binding custom hotkeys and/or cheat codes to your webpage.
jQuery Plugin For Adding Keyboard Shortcuts To Webpage - keyboardShortcut
keyboardShortcut is a jQuery plugin used for creating custom keyboard shortcuts that give your users a quick way to control your web application without using a mouse.
jQuery Plugin For Handling Keyboard Shortcut Events
A jQuery plugin that allows the user to bind keyboard shortcut events to any element and when a key combination is pressed, an event is triggered following that keyboard shortcut.
Keyboard Shortcut Handling Plugin - jQuery ShortcutKeys
A super tiny and easy-to-use jQuery plugin for handling keyboard shortcuts on the webpage. Supports both key names and key codes.
jQuery Plugin To Enable Custom Shortcuts On Your Website - Hotkey Event
Hotkey Event is a cross-platform jQuery plugin for defining (combo) keyboard shortcuts such as 'CONTROL+ALT+PLUS' and binding an event with it.
Vanilla JS Keyboard Shortcut Libraries
Tiny & Robust Keyboard Shortcut Solution For JavaScript – Mousetrap
A powerful, simple JavaScript library to manage keyboard shortcuts in web applications. You can bind keys, combinations of modifier keys like Ctrl and Alt with regular keys, and even full key sequences.
Capture Keyboard Input In Pure JavaScript – hotkeys
The hotkeys JavaScript library allows to capture keyboard input and supports bind custom hotkeys with modifier keys.
Github Hotkey
Trigger an action on an element with a keyboard shortcut.
Create Custom Keyboard Shortcuts With The easyShortcut.js Library
Just another keyboard shortcut JavaScript library for creating “hotkeys” or “cheat codes” on the page.
Create Custom Keyboard Shortcuts With JavaScript – Shortcuts
A JavaScript library to handle keyboard shortcuts that let you create events triggered by custom keyboard combinations.
Conclusion:
Looking for more JavaScript libraries to bind keyboard shortcuts on the web & mobile? See jQuery Keyboard Shortcut and JavaScript Keyboard sections for more details.