Skip to content

@modoki/engine / index / sampleGamepadInto

Function: sampleGamepadInto()

sampleGamepadInto(pad, out, deadzone?): boolean

Merge one gamepad's contribution into out (OR held flags, ADD axes). Returns whether the pad showed any activity this frame (a pressed button or a stick/D-pad past the deadzone) — the caller uses that to set lastDevice. Pure: no DOM.

Parameters

pad

GamepadSnapshot

out

InputFrame

deadzone?

number = 0.2

Returns

boolean

Built with Modoki.