Skip to content

Instantly share code, notes, and snippets.

@videlais
Created December 24, 2013 07:31
Embed
What would you like to do?
Gamepad2
if (self.supported) {
// Firefox
window.addEventListener('MozGamepadConnected',
onGamepadConnect, false);
window.addEventListener('MozGamepadDisconnected',
onGamepadDisconnect, false);
// Chrome
if (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) {
startPolling();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment