Skip to content

vaalentin/keyboard-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keyboard-input

Simple keyboard input for use in a game loop.

Installation

$ npm install --save keyboard-input

Usage

import KeyboardInput from 'keyboard-input';
import { ESC } from '@vaalentin/keycodes';

const keyboard = new KeyboardInput();

// then later
if(keyboard.isPressed(ESC)) {
  // esc is pressed
}

API

input = new KeyboardInput()

input.isPressed(keyCode)

License

MIT, see LICENSE.md for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published