Skip to main content
@gentleduck/shortcutDeprecated

Replaced by duck-vim

A React hook for keyboard shortcuts, now deprecated in favor of @gentleduck/vim. The docs stay up for existing users.

  • Deprecated

    New work happens in @gentleduck/vim. It keeps the same ideas, adds a richer API, and is under active development.

  • Key combos

    Classic combos like ctrl+s or command+k. Case-insensitive and platform-aware.

  • Key sequences

    Konami-style sequences such as Up Up Down Down Left Right B A Enter. They mix freely with combos.

  • useDuckShortcut

    One hook. Pass keys and onKeysPressed, with a single binding or an array of alternatives.

  • One global listener

    A single document-level listener, so mounted instances never fight over events.

  • Move to duck-vim

    @gentleduck/vim is the drop-in successor, with chord bindings, key recording, scoped contexts, and React hooks.

Migrate

Already on duck-shortcut? Move to duck-vim at your own pace. The docs cover the API differences.

  1. Install (deprecated)

    bun add @gentleduck/shortcut
  2. Switch to duck-vim

    bun add @gentleduck/vim

Free & 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.

Become a Sponsor