An open API service indexing awesome lists of open source software.

https://github.com/timwright12/barebones-keycodes

Importable key code mapping
https://github.com/timwright12/barebones-keycodes

Last synced: 10 months ago
JSON representation

Importable key code mapping

Awesome Lists containing this project

README

          

# Barebones KeyCodes
Barebones KeyCodes is a JavaScript utility for mapping keycodes to easy-to-use variables. For a full list of available key options view `./index.js`

## Installation
`npm install @barebones/keycodes --save`

## Usage
```
import { ESCAPE } from @barebones/keycodes;

document.addEventListener( 'keyup', ( e ) => {
console.log(e);
switch ( e.keyCode ) {
case ESCAPE:
alert( 'ESCAPE key was pressed' );
break;
}

} );
```