A lightweight, type-safe TypeScript library for managing complex keyboard shortcuts and multi-key combinations in the browser.
npm install umbr-key-masterbash
npm i umbr-key-master
`
Example usage
`html
KeyMaster Popup Test
KeyMaster Popup Test
Press the keys below to see popups:
- Escape → Alert "Escape key pressed!"
- Control + q → Alert "Control + q pressed!"
`
`js
import { KeyMaster } from "umbr-key-master";
const km = new KeyMaster();
// ---- Single key: Escape ----
km.add(["Escape"], () => {
alert("Escape key pressed!");
});
// ---- Multi-key: Control + S ----
km.add(["Control", "q"], () => {
alert("Control + q pressed!");
});
``