Skip to content

Instantly share code, notes, and snippets.

@luser
Created December 6, 2013 19:01
Show Gist options
  • Save luser/7830293 to your computer and use it in GitHub Desktop.
Save luser/7830293 to your computer and use it in GitHub Desktop.
Gamepad API Events
window.addEventListener("gamepadconnected", function(e) {
console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
e.gamepad.index, e.gamepad.id,
e.gamepad.buttons.length, e.gamepad.axes.length);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment