# shim-keyboard-event-key

> Tiny KeyboardEvent#key shim for IE and MS Edge

Latest version **1.0.3** (published 2019-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install shim-keyboard-event-key
pnpm add shim-keyboard-event-key
yarn add shim-keyboard-event-key
bun add shim-keyboard-event-key
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-10 |
| First published | 2017-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Aleksey Shvayka |
| Maintainers | shvaikalesh |
| Keywords | keyboard-event, key, shim, polyfill, ie, ms-edge |

## Links

- npm: https://www.npmjs.com/package/shim-keyboard-event-key
- Repository: https://github.com/shvaikalesh/shim-keyboard-event-key
- Homepage: https://github.com/shvaikalesh/shim-keyboard-event-key#readme
- Issues: https://github.com/shvaikalesh/shim-keyboard-event-key/issues
- npm.io page: https://npm.io/package/shim-keyboard-event-key

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-03-10
- 1.0.2 — 2018-02-17
- 1.0.1 — 2018-02-17
- 1.0.0 — 2017-07-20

## README

# shim-keyboard-event-key

Tiny `KeyboardEvent#key` shim for IE and MS Edge.

* [MS Edge bug report](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571)
* [Can I use `key`?](http://caniuse.com/#feat=keyboardevent-key)
* [W3C: UI Events spec](https://www.w3.org/TR/uievents)
* [W3C: `key` values](https://www.w3.org/TR/uievents-key)

## Up and running

Get the package from [npm](https://www.npmjs.com/package/shim-keyboard-event-key):

```sh
npm install shim-keyboard-event-key --save
```

And simply require the module:

```js
import "shim-keyboard-event-key"
```

Otherwise, plug it the old-fashioned way:

```html
<script src="https://unpkg.com/shim-keyboard-event-key" async></script>
```

## Example

```js
document.addEventListener("keyup", event => {
  if (event.defaultPrevented) return

  switch (event.key) {
    case "ArrowLeft":
    case "PageUp":
      player.prev()
      break

    case "ArrowRight":
    case "PageDown":
      player.next()
      break
  }
})
```

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