Duck Shortcut
Deprecated React keyboard shortcut hook — superseded by @gentleduck/vim. Still documented for existing users.
Prefer duck-vim for new projects
Duck Shortcut still works, but it’s in maintenance mode. `@gentleduck/vim` covers every feature here plus key recording, chord bindings, scoped contexts, and platform-aware Mod resolution.
Deprecated
This package is deprecated. Use `@gentleduck/vim` instead — same ideas, richer API, active development.
Key combinations
Classic combos like `ctrl+s` or `command+k`. Case-insensitive, platform-aware.
Key sequences
Konami-style sequences — `Up Up Down Down Left Right B A Enter`. Mixes seamlessly with combinations.
useDuckShortcut
One hook. Pass `keys` and `onKeysPressed`. Works with a single binding or an array of alternatives.
Global listener
Single document-level listener, no event-capture conflicts between mounted instances.
Migrate to duck-vim
`@gentleduck/vim` is a drop-in successor with chord bindings, key recording, scoped contexts, and React hooks.
Migration path
Already using duck-shortcut? Swap to duck-vim at your pace — the docs cover the API diff.
# Deprecated — prefer @gentleduck/vim
bun add @gentleduck/shortcut
# Upgrade path
bun add @gentleduck/vimFree & open source
gentleduck is MIT licensed and will always be free and open source. Every package ships with full source access — fork it, modify it, own it.