standard-mapper/gamepad.js
function (event) {
    // Add the new gamepad on the list of gamepads to look after.
    gamepadSupport.gamepads.push(event.gamepad);

    // Ask the tester to update the screen to show more gamepads.
    window.tester.updateGamepads(gamepadSupport.gamepads);

    // Start the polling loop to monitor button changes.
    gamepadSupport.startPolling();
  }
function (event) {
    // Add the new gamepad on the list of gamepads to look after.
    gamepadSupport.gamepads.push(event.gamepad);

    // Ask the tester to update the screen to show more gamepads.
    window.tester.updateGamepads(gamepadSupport.gamepads);

    // Start the polling loop to monitor button changes.
    gamepadSupport.startPolling();
  }
function ( event ) { // Add the new gamepad on the list of gamepads to look after. gamepadSupport . gamepads . push ( event . gamepad ) ; // Ask the tester to update the screen to show more gamepads. window . tester . updateGamepads ( gamepadSupport . gamepads ) ; // Start the polling loop to monitor button changes. gamepadSupport . startPolling ( ) ; }
React to the gamepad being connected.
React to the gamepad being connected .