Project-Rekt / engine

Game Engine - Currently on version MASON
https://project-rekt.github.io/engine/index.html
Apache License 2.0
1 stars 3 forks source link

Bug with inputhandler when specifying custom eventhandler functions #21

Open Squishy123 opened 4 years ago

Squishy123 commented 4 years ago

If you create an inputhandler with a custom function it breaks.

this.input = new InputHandler(document.querySelector('body'), {
            "keydown": this.handleInput
});

Currently a work-around is to wrap the function in an array

this.input = new InputHandler(document.querySelector('body'), {
            "keydown": [this.handleInput]   
});

Probably something wrong with handler linking in the constructor.