key_inputs
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Al engine

Core

Module for handle key inputs in Al engine

// creating instance
const keyInputs = new KeyInputs();
// then initiate
keyInputs.init();

// each frame collect a key data
const result = keyInputs.collect();

// collected data have arrays with pressed and hold key 
result.keysPress;
result.keysHold;

// and functions to check witch key was pressed and hold
result.isPressed('w');
result.isHolded(' ');

// you can clean listeners if needed
keyInputs.clean();

Readme

Keywords

none

Package Sidebar

Install

npm i key_inputs

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

16.6 kB

Total Files

12

Last publish

Collaborators

  • sasha-z