1.4.7 • Published 6 years ago

keycodemap v1.4.7

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

keycodemap

A small library to map keycodes to key names. Examples:

64 = 'A'
59 = 'SEMICOLON'
...

Features

You can change the keyboard layout by country string defined after 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

Usage

Install the package using npm with npm install --save keycodemap.

Import it to your project

const keycodemap = require('keycodemap');

The default location is 'US'. Now you can use map() to get the key names:

// 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

// newLocationString i a ISO 3166-1 string e.g. "DE"
keycodemap.useMap(newLocationString);
1.4.7

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago