# simple-keyboard-handler

> A singleton module to catch keyboard events and then fire callbacks

Latest version **0.3.0** (published 2017-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-keyboard-handler
pnpm add simple-keyboard-handler
yarn add simple-keyboard-handler
bun add simple-keyboard-handler
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2017-09-22 |
| First published | 2017-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marcus Blättermann |
| Maintainers | essenmitsosse |
| Keywords | javascript, js, helper, vanilla, keyboard, keystroke |

## Links

- npm: https://www.npmjs.com/package/simple-keyboard-handler
- Repository: https://github.com/essenmitsosse/simple-keyboard-handler
- Homepage: https://github.com/essenmitsosse/simple-keyboard-handler#readme
- Issues: https://github.com/essenmitsosse/simple-keyboard-handler/issues
- npm.io page: https://npm.io/package/simple-keyboard-handler

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.0 (latest) — 2017-09-22
- 0.2.0 — 2017-09-22
- 0.1.1 — 2017-09-22
- 0.1.0 — 2017-09-20

## README

# Simple Keyboard Handler

[![Build Status](https://travis-ci.org/essenmitsosse/simple-keyboard-handler.svg)](https://travis-ci.org/essenmitsosse/simple-keyboard-handler) [![Coverage Status](https://coveralls.io/repos/github/essenmitsosse/simple-keyboard-handler/badge.svg)](https://coveralls.io/github/essenmitsosse/simple-keyboard-handler) [![Dependency Status](https://david-dm.org/essenmitsosse/simple-keyboard-handler.svg)](https://david-dm.org/essenmitsosse/simple-keyboard-handler)

A singleton module to catch keyboard events and then fire callbacks.

If you require this in your project it will automatically be initalized and add an eventListener.

# Usage

```javascript
var keyBoardHandler = require( "simple-keyboard-handler" );

// Maps SHIFT+K to the passed function
keyBoardHandler.addShortcut( {
    keyCode: 75 // keycode for 'k'
    ctrl: false // defaults to false
    shift: true // defaults to false
    alt: false // defaults to false
}, function () {
    console.log( "This is my callback." );
} );
```

If you don't know a keycode, checkout [keycode.info](http://keycode.info/)

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