跳转到内容

GamepadSnapshot

此内容尚不支持你的语言。

Defined in: platform/types.ts:67

A per-frame snapshot of one gamepad. With mapping === 'standard' the button and axis indices follow the W3C “standard gamepad” layout (see GamepadButton / GamepadAxis in input.ts). buttons[i] is analog in [0,1] (1 = fully pressed); axes[i] is signed in [-1,1]. Gamepads are POLLED (no DOM events), so the platform produces these each frame rather than via InputEventCallbacks.

axes: number[]

Defined in: platform/types.ts:71


buttons: number[]

Defined in: platform/types.ts:70


connected: boolean

Defined in: platform/types.ts:69


index: number

Defined in: platform/types.ts:68


mapping: string

Defined in: platform/types.ts:72