Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / GamepadSnapshot

Type Alias: GamepadSnapshot ​

ts
type GamepadSnapshot = {
  index: number;
  id: string;
  family: GamepadFamily;
  standard: boolean;
  buttons: number[];
  axes: number[];
};

Defined in: input/gamepad.ts:147

One pad's state for a frame, read from navigator.getGamepads().

Properties ​

PropertyTypeDescriptionDefined in
indexnumber-input/gamepad.ts:148
idstring-input/gamepad.ts:149
familyGamepadFamily-input/gamepad.ts:150
standardbooleanFalse when the browser doesn't report the standard layout; buttons may be elsewhere.input/gamepad.ts:152
buttonsnumber[]-input/gamepad.ts:153
axesnumber[]-input/gamepad.ts:154