gamepad API

"Defines a low-level interface that represents gamepad devices in the browser." --W3C

Can I use it now?

The gamepad API is a W3C draft.

Currently only Chrome and Firefox have implementations.

Chrome requires you to enable it on the chrome://flags page.

Firefox requires a special build found here.

How low can you go?

The API is low-level.

There are no events. It relies on you polling the system for gamepad state changes.

Don't like limbo?

gamepad.js offers a wrapper for the low-level API.

Abstracts out vender prefixes (webkit, moz, etc.) and creates a common mapping for controller buttons and axes.

Why?

Gamepads are ubiquitous with video games.

With WebGL and Canvas2D, video games with JS and HTML are ready for the front stage.

Controlling websites with navigators and remotes is also possible now.

Links