Designing for Television, Part 3

Using the Gamepad API and Controller.js

Samir Zahran
Sep 8, 2016 · 8 min read
Image for post
Image for post

Here’s how the Gamepad API works

Image for post
Image for post
The W3C’s Standard Gamepad

What the API is missing

1. Layouts and input names

Image for post
Image for post
A list of the button names available for Standard Gamepad layouts
Image for post
Image for post
Controller.js combines axes into LEFT_ANALOG_STICK and RIGHT_ANALOG_STICK

2. Events

Both angle values are NaN (Not-A-Number) when x and y are both 0

3. Settings

Gamepad compatibility

Getting started

Discovering gamepads

Reacting to button events

Configuring settings



This Also

We help companies design products for mobile & beyond.

Thanks to Molly Lafferty

Samir Zahran

Written by

Associate Technical Director at @Instrument in Brooklyn, NY (formerly @ThisAlso). He/him.

This Also

This Also

We help companies design products for mobile & beyond. Our studio is located in Brooklyn, NY.

Samir Zahran

Written by

Associate Technical Director at @Instrument in Brooklyn, NY (formerly @ThisAlso). He/him.

This Also

This Also

We help companies design products for mobile & beyond. Our studio is located in Brooklyn, NY.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store