/keys

Keyboard and remote control keys codes.

Primary LanguageJavaScriptOtherNOASSERTION

Remote control

build status npm version dependencies status devDependencies status Gitter

Generated by remote controls and keyboards key codes used in STB applications. At the moment keypress and keydown events are emitted for the same keys (for both printable and non-printable characters). Key code is its default key code from event plus 1000 in case shift key pressed and plus 2000 in case alt key pressed.

Installation

npm install stb-keys

Usage

Add to the scope:

var keys = require('stb-keys');

In some event handler:

if ( event.code === keys.ok ) {
    ...
}

Contribution

If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.

License

stb-keys is released under the MIT License.