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

    Class KeyboardMouseSourceAlpha

    Keyboard and mouse input source class. Attached to an element, it accumulates key deltas for the keys listed in keyCode, button deltas for the mouse buttons, mouse deltas for pointer movement and wheel deltas for the scroll wheel. Pass pointerLock: true to use pointer lock for mouse movement.

    Hierarchy (View Summary)

    Index
    _button: number[] = ...
    _element: HTMLElement | null = null
    deltas: {
        button: InputDelta;
        key: InputDelta;
        mouse: InputDelta;
        wheel: InputDelta;
    } = ...

    Type Declaration

    keyCode: {
        "0": 26;
        "1": 27;
        "2": 28;
        "3": 29;
        "4": 30;
        "5": 31;
        "6": 32;
        "7": 33;
        "8": 34;
        "9": 35;
        A: 0;
        B: 1;
        C: 2;
        CTRL: 42;
        D: 3;
        DOWN: 37;
        E: 4;
        F: 5;
        G: 6;
        H: 7;
        I: 8;
        J: 9;
        K: 10;
        L: 11;
        LEFT: 38;
        M: 12;
        N: 13;
        O: 14;
        P: 15;
        Q: 16;
        R: 17;
        RIGHT: 39;
        S: 18;
        SHIFT: 41;
        SPACE: 40;
        T: 19;
        U: 20;
        UP: 36;
        V: 21;
        W: 22;
        X: 23;
        Y: 24;
        Z: 25;
    } = KEY_CODES

    The key codes for the keyboard keys.

    • 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 { button: number[]; key: number[]; mouse: number[]; wheel: number[] }

      • button: number[]

        The button deltas.

      • key: number[]

        The key deltas.

      • mouse: number[]

        The mouse deltas.

      • wheel: number[]

        The wheel deltas.