Library for key-code constants in ECMAScript/Javascript
npm install key-codeFor more information see this.
See key-code.js for a full list of all the constants
``sh`
npm install --save key-code
`sh`
bower install --save key-code
Include the package using CommonJS require()
`js`
var KeyCode = require('key-code');
or ES2015 import:
`js`
// ES2015+
import KeyCode from 'key-code';
`html
`
`js`
function myFunction(event) {
if (event.keyCode === KeyCode.ENTER) {
alert('keypress ENTER');
}
}
The key-code` project is under MIT license.