1.0.0 • Published 8 years ago

keyboard-input v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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](https://github.com/vaalentin/keyboard-input/blob/master/LICENSE.md) for more details.