# vue-use-hotkeys

> Vue composition for using keyboard shortcuts in components

Latest version **0.4.0** (published 2023-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-use-hotkeys
pnpm add vue-use-hotkeys
yarn add vue-use-hotkeys
bun add vue-use-hotkeys
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-08-27 |
| First published | 2022-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mitscherlich |
| Maintainers | mitscherlich36 |

## Links

- npm: https://www.npmjs.com/package/vue-use-hotkeys
- Repository: https://github.com/Mitscherlich/vue-use-hotkeys
- Homepage: https://github.com/Mitscherlich/vue-use-hotkeys#readme
- Issues: https://github.com/Mitscherlich/vue-use-hotkeys/issues
- npm.io page: https://npm.io/package/vue-use-hotkeys

## Dependencies (2)

- [vue-demi](https://npm.io/package/vue-demi.md) ^0.14.5
- [hotkeys-js](https://npm.io/package/hotkeys-js.md) ^3.12.0

## Recent versions

- 0.4.0 (latest) — 2023-08-27
- 0.3.5 — 2022-12-28
- 0.3.4 — 2022-12-03
- 0.3.3 — 2022-05-24
- 0.3.2 — 2022-05-11
- 0.3.1 — 2022-05-07
- 0.3.0 — 2022-04-19
- 0.2.0 — 2022-03-22
- 0.1.1 — 2022-01-25
- 0.1.0 — 2022-01-22

## README

# vue-use-hotkeys

Vue composition for using keyboard shortcuts in components.
This is a hook version for [hotkeys](https://github.com/jaywcjlove/hotkeys) package.

## Install

via pnpm, yarn or npm:

```sh
$ pnpm add vue-use-hotkeys
# or
$ yarn add vue-use-hotkeys
# or
$ npm i -S vue-use-hotkeys
```

## Usage

```jsx
import { defineComponent, ref } from 'vue'
import { useHotkeys } from 'vue-use-hotkeys'

export default defineComponent(() => {
  const count = ref(0)

  useHotKeys('ctrl + k', () => {
    count.value += 1
  })

  return () => (
    <p>
      Pressed <kbd>ctrl + k</kbd> {count.value} times.
    </p>
  )
})
```

Preview demo:

- [CodeSandbox Example](https://codesandbox.io/s/vue-use-hotkeys-demo-6kygbb)

# To-Do(s)

- [x] add support of `@vue/composition-api`;

## License

MIT &copy; [Mitscherlich](https://mitscherlich.me)

---
_Source: https://npm.io/package/vue-use-hotkeys · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
