Namespace: gamepad

syngen.input.gamepad

Queries gamepad input once per frame and exposes its state.

Source:

Methods

(static) get() → {Object}

Returns the gamepad state.

Source:
Returns:
Type
Object

(static) getAnalog(button, invertopt) → {Number}

Returns the analog input for button.

Parameters:
Name Type Attributes Default Description
button Number
invert Boolean <optional>
false
Source:
Returns:
Type
Number

(static) getAxis(axis, invertopt) → {Number}

Returns the analog input for axis.

Parameters:
Name Type Attributes Default Description
axis Number
invert Boolean <optional>
false
Source:
Returns:
Type
Number

(static) hasAxis() → {Number}

Returns whether one or more axes exist.

Parameters:
Name Type Attributes Description
...axes Number <repeatable>
Source:
Returns:
Type
Number

(static) isDigital(button) → {Number}

Returns whether button is pressed.

Parameters:
Name Type Description
button Number
Source:
Returns:
Type
Number

(static) reset()

Resets the gamepad state.

Source:

(static) setDeadzone(valueopt)

Sets the deadzone for axis input under which smaller values are considered zero.

Parameters:
Name Type Attributes Default Description
value Number <optional>
0

Float within [0, 1]. For best results use a small configurable value.

Source:

(static) update()

Queries the gamepad state.

Source:
Listens to Events: