powerkeys
v0.2.0
Published
VS Code-style keyboard shortcuts for modern web apps
Downloads
570
Readme
powerkeys
Purpose
powerkeys brings VS Code-style keyboard shortcuts to modern web apps. It handles
scoped bindings, multi-step sequences, when clauses, editable-target policies,
shortcut recording, atomic rebinding through binding sets, pre-dispatch
candidate guards, and external availability checks in one small runtime.
Installation
pnpm add powerkeysQuick Example
import { createShortcuts } from 'powerkeys'
const shortcuts = createShortcuts({ target: document })
shortcuts.bind({
combo: 'Mod+k',
preventDefault: true,
handler: () => {
openCommandPalette()
},
})Documentation Map
- Conceptual guide: docs/context.md
- Runnable examples: examples/basic-usage.ts, examples/customizable-shortcuts.ts, examples/command-availability.ts, examples/scopes-and-when.ts, examples/sequences.ts, examples/record-shortcut.ts
- Exact exported signatures: dist/index.d.mts
- Interactive demo: demo/src/App.tsx
