Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class InputSource<T>Alpha

    The base class for all input devices. An input source is an InputFrame that fills its own deltas from DOM events or device polling once attach is given an element, and stops on detach. Call InputFrame#read once per frame to take the accumulated deltas. The built-in sources are KeyboardMouseSource, GamepadSource, MultiTouchSource, SingleGestureSource and DualGestureSource; subclass this to add another device.

    The shape of the input source.

    Type Parameters

    • T extends Record<string, number[]>

      The shape of the input source.

    Hierarchy (View Summary)

    Index
    _element: HTMLElement | null = null
    deltas: { [K in string | number | symbol]: InputDelta } = ...
    • 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

      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.