axes property

Array of current axis values supported by the gamepad device.

This property is read-only.

Syntax


var anAxes = gamepad.axes;

Property values

Type: Array of number

ValueCondition
-1.0–-0.0

Depending on the axis, negative values represent movement in the "up" or "left" directions.

0.0–1.0

Depending on the axis, positive values represent movement in the "down" or "right" directions.

 

Remarks

Certain gamepad controls may return values even though the associated control appears to be centered and at rest. This depends on a number of factors, including the sensitivity of the gamepad device, the quality of the driver, and the amount of wear on the gamepad. This phenomenon, also known as dead zone, can be handled by delaying input response until the value changes beyond a certain threshold value, typically ±0.10.

See also

gamepad

 

 

Show: