Gamepad object

Gamepad objects describe the state of the buttons and axes associated with a gamepad device at a given time. Use the Navigator.getGamepads function to retrieve an array of gamepad objects representing the gamepad devices connected to the device running Internet Explorer.

Syntax


var aGamepads = navigator.getGamepads();

DOM Information

Inheritance Hierarchy

The Gamepad does not inherit from any class or interface.

Members

The Gamepad object has these types of members:

Properties

The Gamepad object has these properties.

PropertyAccess typeDescription

axes

Read-only

Array of current axis values supported by the gamepad device.

buttons

Read-only

Array of states for the buttons supported by the gamepad device.

connected

Read-only

Indicates whether the gamepad device is connected.

displayId

Read-only

The displayId property returns the VRDisplay that is associated with this Gamepad object.

hand

Read-only

The hand property specifies the hand that the controller is held in or is most likely to be held in.

hapticActuators

Read-only

The hapticActuators property returns an array of all the haptic actuators in the gamepad.

id

Read-only

Description of the gamepad device as reported by the underlying driver.

index

Read-only

The index position of the Gamepad object in the array reported by the navigator.getGamepads function.

mapping

Read-only

A string representing the current configuration (mapping) of the controls on the gamepad device.

pose

Read-only

The pose property returns the current pose of the gamepad.

timestamp

Read-only

A value representing the time the Gamepad object was recorded.

 

 

 

Show: