Interface MouseEventReceiverInterface

Mouse and touch events

interface MouseEventReceiverInterface {
    onClick?(pos: MouseEventCoordinatesInterface, instanceId?: number): boolean;
    onDoubleClick?(pos: MouseEventCoordinatesInterface, instanceId?: number): boolean;
    onDrag?(position: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): void;
    onDragCancel?(instanceId?: number): void;
    onDragEnd?(position: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): void;
    onDragStart?(position: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): boolean;
    onHold?(pos: MouseEventCoordinatesInterface, instanceId?: number): boolean;
    onMouseMove?(pos: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): void;
    onMouseOut?(pos: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): void;
    onMouseOver?(pos: MouseEventCoordinatesInterface, viewport: ViewportInterface, instanceId?: number): void;
    onMouseWheel?(pos: MouseEventCoordinatesInterface, delta: number, instanceId?: number): boolean;
}

Methods

  • Called for mouse clicks and taps

    Parameters

    Returns boolean

    Return true to consume the event, false to pass it on

  • Called for double clicks and double taps

    Parameters

    Returns boolean

    Return true to consume the event, false to pass it on

  • Called during dragging

    Parameters

    Returns void

  • Called when the user cancels dragging by pressing the escape key

    Parameters

    • OptionalinstanceId: number

      The index of the instance if the event occurred on an InstancedMesh.

    Returns void

  • Called when the user releases the mouse button after dragging

    Parameters

    Returns void

  • Called when the user starts dragging the target

    Parameters

    Returns boolean

  • Called for click-and-hold and touch-and-hold

    Parameters

    Returns boolean

    Return true to consume the event, false to pass it on

  • Called when the mouse is moved

    Parameters

    Returns void

  • Called when the mouse pointer leaves the target

    Parameters

    Returns void

  • Called when the mouse is hovered on the target

    Parameters

    Returns void

  • Called when the mouse wheel is turned

    Parameters

    • pos: MouseEventCoordinatesInterface

      Mouse position

    • delta: number

      Mouse wheel delta

    • OptionalinstanceId: number

      The index of the instance if the event occurred on an InstancedMesh.

    Returns boolean