Fork me on GitHub

decoupled-input

Input handling for HTML5 games done right.

About

decoupled-input is a flexible and lightweight input controller for games that allows to separate input listeners for different devices from the actual input computing logic.

This allows to change input bindings and devices without having to change the program logic; e.g. if the "fire" action was bound to the space key and it should later be bound to a mouse button, the change is only being made in the bindings configuration, and the game logic remains entirely unaffected.

Other benefits are:

decoupled-input comes with handlers for mouse, keyboard and gamepad.

How It Works

For usage details and everything else, please check the project's README.

Dependecies

None. Well, an AMD loader should be available.

License

MIT. For details, see the LICENSE file in the repository.