0.1.0 • Published 3 years ago

key_inputs v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

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