# kee

> Turn keyboard events into legible key names.

Latest version **1.0.0** (published 2016-12-03) · 0 weekly downloads

## Install

```sh
npm install kee
pnpm add kee
yarn add kee
bun add kee
```

## 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.0 |
| Published | 2016-12-03 |
| First published | 2016-12-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | twhb |

## Links

- npm: https://www.npmjs.com/package/kee
- npm.io page: https://npm.io/package/kee

## Recent versions

- 1.0.0 (latest) — 2016-12-03
- 0.0.0 — 2016-12-03

## README

# kee.js

Turn keyboard events into legible key names.

- Home: https://github.com/twhb/kee.js
- Demo: https://twhb.github.io/kee.js/demo.html
- npm: kee

## Introduction

This library exists because the same few bugs show up in most websites that implement keyboard shortcuts:

- Poor cross-OS support
- Poor cross-browser support
- Modifiers are sometimes ignored
- Key handling code is unreadable and difficult to maintain

Code using kee.js will neither have any of these issues, nor ever need to consider them.

## API

### `kee(event)`

Returns a string naming the key press than generated `event`.

**event**: A `KeyboardEvent` with type `'keyup'` or `'keydown'`.

## Key press string format

Key press strings consist of all held modifiers, each followed by "+", follwed by the pressed key.

A key's name is its physical label, in lower case, with spaces removed. It is not always what the press would type - for example, "shift" types nothing, and "shift+4" types "$" (on a US keyboard).

Modifiers are "ctrl", "alt", "shift", and "windows", and always appear in that order. macOS's "Command" is given as "ctrl", and its Option as "alt".

If a key press can't be identified then the string `'unidentified'` is returned. This shouldn't happen except on custom hardware.

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