Interface MouseEvent

A mouse event payload.

Hierarchy

  • BaseInputEvent<"mouse">
    • MouseEvent

Properties

button: "left" | "right" | "middle"

The mouse button.

down: boolean

Whether the button was pressed.

movement: {
    x: number;
    y: number;
}

The movement of the mouse position. Useful e.g. for pointer-locked apps like games.

Type declaration

  • x: number

    The movement on the x-axis. Expressed in terms of lighthouse columns, but may be negative.

  • y: number

    The movement on the y-axis. Expressed in terms of lighthouse rows, but may be negative.

pointerLocked: boolean

Whether the mouse pointer was locked (e.g. to the frontend's canvas).

pos: {
    x: number;
    y: number;
}

The position.

Type declaration

  • x: number

    The x-coordinate in terms of lighthouse columns, i.e. in the range 0-28.

  • y: number

    The y-coordinate in terms of lighthouse rows, i.e. in the range 0-14.

source: string | number

The identifier, unique per client + device combo.

type: "mouse"

The event type.

Generated using TypeDoc