Skip to content

timwright12/barebones-keycodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
	}
	
} );

About

Importable key code mapping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published