Options
All
  • Public
  • Public/Protected
  • All
Menu

Management class for Gamepad events

Hierarchy

  • GamepadManager

Index

Constructors

Properties

_gamepadPoller: Timer
GAMEPAD_POLLER_INTERVAL_MS: number = 100

How often Gamepad polling should check for button presses

Methods

  • _onGamepadConnect(event: GamepadEvent): void
  • Handles a Gamepad Connection event, adding its info to the poll list

    Parameters

    • event: GamepadEvent

      The originating Event

    Returns void

  • _onGamepadDisconnect(event: GamepadEvent): void
  • Handles a Gamepad Disconnect event, removing it from consideration for polling

    Parameters

    • event: GamepadEvent

      The originating Event

    Returns void

  • _pollGamepads(): void
  • Polls all Connected Gamepads for updates. If they have been updated, checks status of Axis and Buttons, firing off Keybinding Contexts as appropriate

    Returns void

  • _handleGamepadInput(gamepadId: string, up: boolean, repeat?: boolean): void
  • Converts a Gamepad Input event into a KeyboardEvent, then fires it

    Parameters

    • gamepadId: string

      The string representation of the Gamepad Input

    • up: boolean

      True if the Input is pressed or active

    • repeat: boolean = false

      True if the Input is being held

    Returns void