Interface Mouse

Libra Mouse

Mouse

interface Mouse {
    click: ((x: number, y: number, options?: {
        button?: "left" | "right" | "middle";
        delay?: number;
    }) => Promise<void>);
    down: ((options?: {
        button?: "left" | "right" | "middle";
    }) => Promise<void>);
    move(x: number, y: number): Promise<void>;
    up(options?: {
        button?: "left" | "right" | "middle";
    }): Promise<void>;
    wheel(deltaX: number, deltaY: number): Promise<void>;
}

Properties

Methods

Properties

click: ((x: number, y: number, options?: {
    button?: "left" | "right" | "middle";
    delay?: number;
}) => Promise<void>)
down: ((options?: {
    button?: "left" | "right" | "middle";
}) => Promise<void>)

Dispatches a mousedown event.

Methods

  • Dispatches a mousemove event.

    Parameters

    • x: number
    • y: number

    Returns Promise<void>

  • Dispatches a mouseup event.

    Parameters

    • Optionaloptions: {
          button?: "left" | "right" | "middle";
      }
      • Optionalbutton?: "left" | "right" | "middle"

        Defaults to left.

    Returns Promise<void>

  • Dispatches a wheel event.

    NOTE Wheel events may cause scrolling if they are not handled, and this method does not wait for the scrolling to finish before returning.

    Parameters

    • deltaX: number

      Pixels to scroll horizontally.

    • deltaY: number

      Pixels to scroll vertically.

    Returns Promise<void>