Phaser API Documentation

  Version: 
Event: CONNECTED
Phaser.Input.Gamepad.Events.CONNECTED
CONNECTED

Description:

The Gamepad Connected Event.

This event is dispatched by the Gamepad Plugin when a Gamepad has been connected.

Listen to this event from within a Scene using: this.input.gamepad.once('connected', listener).

Note that the browser may require you to press a button on a gamepad before it will allow you to access it, this is for security reasons. However, it may also trust the page already, in which case you won't get the 'connected' event and instead should check GamepadPlugin.total to see if it thinks there are any gamepads already connected.

Parameters:

name type description
pad Phaser.Input.Gamepad

A reference to the Gamepad which was connected.

event Event

The native DOM Event that triggered the connection.

Since: 3.0.0