JSPM

key-code

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 211
  • Score
    100M100P100Q87628F
  • License MIT

Library for key-code constants in ECMAScript/Javascript

Package Exports

  • key-code

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (key-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

key-code

Library for key-code constants in ECMAScript/Javascript

For more information see this.

See key-code.js for a full list of all the constants

Installation

Using NPM

npm install --save key-code

Using Bower

bower install --save key-code

Usage

Using NodeJs

Include the package using CommonJS require()

var KeyCode = require('key-code');

or ES2015 import:

// ES2015+
import KeyCode from 'key-code';

Using Browser

<!-- Load files. -->
<script src="/path/to/key-code/dist/key-code.js"></script>

<input type="text" onkeydown="myFunction(event)">
function myFunction(event) {
    if (event.keyCode === KeyCode.ENTER) {
        alert('keypress ENTER');
    }
}

License

The key-code project is under MIT license.