Engine API Reference - v2.20.0-beta.0
    Preparing search index...

    Class InputSource<T>Alpha

    The base class for all input devices.

    The shape of the input source.

    Type Parameters

    • T extends Record<string, number[]>

      The shape of the input source.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Alpha

      Type Parameters

      • T extends Record<string, number[]>

        The shape of the input source.

      Parameters

      • data: T

        The input frame data, where each key corresponds to an input delta.

      Returns InputSource<T>

    Properties

    _element: HTMLElement | null = null
    deltas: { [K in string | number | symbol]: InputDelta } = ...

    Methods

    • Alpha

      Parameters

      Returns void

    • Alpha

      Returns void

    • Alpha

      Returns void

    • Alpha

      Fires an event with the given name and arguments.

      Parameters

      • event: string

        The event name to fire.

      • ...args: any[]

        The arguments to pass to the event listeners.

      Returns void

    • Alpha

      Removes an event listener for the specified event.

      Parameters

      • event: string

        The event name to stop listening for.

      • callback: HandleEventCallback

        The callback function to remove.

      Returns void

    • Alpha

      Adds an event listener for the specified event.

      Parameters

      • event: string

        The event name to listen for.

      • callback: HandleEventCallback

        The callback function to execute when the event is triggered.

      Returns void

    • Alpha

      Returns the current frame state and resets the deltas to zero.

      Returns { [K in string | number | symbol]: number[] }

      • The flushed input frame with current deltas.