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
- Host: GitHub
- URL: https://github.com/timwright12/barebones-keycodes
- Owner: timwright12
- License: mit
- Created: 2018-11-13T13:30:28.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-20T12:49:26.000Z (over 2 years ago)
- Last Synced: 2025-08-13T20:54:33.888Z (11 months ago)
- Language: JavaScript
- Size: 12.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
}
} );
```