# keycodemap

> This is a project to map keyCodes/which properties of keyevents to localized key values.

Latest version **1.4.7** (published 2018-02-02) · ISC license · 0 weekly downloads

## Install

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

## 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.4.7 |
| Published | 2018-02-02 |
| First published | 2017-08-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pascal Pothmann |
| Maintainers | p0thi |

## Links

- npm: https://www.npmjs.com/package/keycodemap
- Repository: https://github.com/p0thi/keycodemap
- Homepage: https://github.com/p0thi/keycodemap#readme
- Issues: https://github.com/p0thi/keycodemap/issues
- npm.io page: https://npm.io/package/keycodemap

## Recent versions

- 1.4.7 (latest) — 2018-02-02
- 1.4.6 — 2018-02-02
- 1.4.5 — 2018-02-02
- 1.4.4 — 2018-02-02
- 1.4.3 — 2018-02-02
- 1.4.2 — 2018-02-02
- 1.4.1 — 2018-02-01
- 1.4.0 — 2018-02-01
- 1.3.1 — 2018-02-01
- 1.3.0 — 2018-01-31
- 1.2.7 — 2018-01-31
- 1.2.6 — 2018-01-31
- 1.2.5 — 2018-01-31
- 1.2.4 — 2018-01-31
- 1.2.3 — 2018-01-31
- … 14 more at https://npm.io/package/keycodemap/versions

## README

# keycodemap
> A small library to map keycodes to key names.
**Examples:**
```javascript
64 = 'A'
59 = 'SEMICOLON'
...
``` 
# Features
You can change the keyboard layout by country string defined after [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) .
Example for United States of America = "US".
You can pass in a javascript key event or the key code as a number to get the Name.
# Currently available maps
<details>
<summary>Click to expand</summary>
United States of America ("US")
Germany ("DE")
</details>

# Usage
Install the package using `npm` with `npm install --save keycodemap`.

Import it to your project
```javascript
const keycodemap = require('keycodemap');
```
The default location is 'US'. 
Now you can use `map()` to get the key names:
```javascript
// event is a javascript key event or a number
var name = keycodemap.map(event);

// e.g. if the key code was 59 it will print 'SEMICOLON'
console.log(name);
```
To change the locale, just call
```javascript
// newLocationString i a ISO 3166-1 string e.g. "DE"
keycodemap.useMap(newLocationString);
```

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