Evidently Input
A set of classes to make it easier and simpler to work with input (Mouse/Keyboard) in your games.
Getting Started
The full documentation can be found here.
Installing
Add it to your project via:
npm i --save evidently-input
Documentation
The simplest way to use this library is as follows:
- Create a new instance of
MouseInput
/KeyboardInput
. - Call
registerListeners()
passingdocument
to it, to register the necessary listeners. - At the end of every frame call
update()
, it must be done after you've done using the input methods. - Where needed call the appropriate methods (eg.
keyboardInput.isKeyDown()-
).
An example code:
const mouseInput = ;const keyboardInput = ; // Registers necessary event listeners on the documentmouseInput;keyboardInput; ;
License
This project is licensed under the MIT License - see the LICENSE.md file for details