Fork me on GitHub


Input handling for HTML5 games done right.


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.


None. Well, an AMD loader should be available.


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