Add Ctrl+S to save and Ctrl+Z to undo in a browser-based editor without a heavy keyboard library.
Create scope groups so pressing the same key does different things depending on which panel or modal is active.
Query which modifier keys the user is holding right now to build custom multi-key interaction logic.
Enable and disable individual shortcuts dynamically as the user navigates between sections of your app.
| jaywcjlove/hotkeys-js | civitai/civitai | companion-inc/feynman | |
|---|---|---|---|
| Stars | 7,098 | 7,107 | 7,088 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | hard | moderate |
| Complexity | 1/5 | 4/5 | 3/5 |
| Audience | developer | developer | researcher |
Figures from each repo's GitHub metadata at analysis time.
Install via npm or use a plain script tag, no config, bundler, or build setup required.
Hotkeys.js is a small JavaScript library for detecting keyboard shortcuts in a web browser. It lets developers define combinations like Ctrl+S or Shift+A and run code when a user presses them. The library has no external dependencies and is tiny in size, around 8 kilobytes, so it adds almost no weight to a web page. Using it is straightforward: you call a single function with the key combination you want to watch for and a callback function that runs when that combination is pressed. You can define multiple shortcuts for the same action, and you can turn individual shortcuts on and off without removing them. The library also supports a scope system, which means you can group shortcuts by name and switch between groups, so pressing the same key does different things depending on which part of your app is active. The library understands modifier keys like Command, Control, Shift, Option, and Alt, and it can tell which of them are currently held down at any moment. It also provides a way to query which keys are pressed right now, not just react to combinations. Hotkeys.js works in all major browsers and can be loaded via a standard script tag or pulled in through the npm package manager used by Node-based build tools. The README includes short code samples for common use cases and links to a documentation site. The project is open source and maintained by an independent developer.
A tiny 8KB JavaScript library for adding keyboard shortcuts like Ctrl+S or Shift+A to web apps, with scope grouping so the same key does different things in different parts of your app.
Mainly TypeScript. The stack also includes TypeScript, JavaScript, npm.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.