Skip to content

Instantly share code, notes, and snippets.

@mrmcpowned
Created July 13, 2015 15:35
Show Gist options
  • Save mrmcpowned/e32a45ae6135f2da5dc0 to your computer and use it in GitHub Desktop.
Save mrmcpowned/e32a45ae6135f2da5dc0 to your computer and use it in GitHub Desktop.
var gamepadsChanged = false;
for (var i = 0; i < rawGamepads.length; i++) {
if (typeof rawGamepads[i] != gamepadSupport.prevRawGamepadTypes[i]) {
gamepadsChanged = true;
gamepadSupport.prevRawGamepadTypes[i] = typeof rawGamepads[i];
}
if (rawGamepads[i]){
gamepadSupport.gamepads.push(rawGamepads[i]);
var g = gamepadSupport.blacklisted.length;
while (g--){
if (typeof gamepadSupport.gamepads[i] != "undefined" && gamepadSupport.gamepads[i].id.search(gamepadSupport.blacklisted[g]) !== -1) {
gamepadSupport.gamepads.splice(i, 1);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment