Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mouse

Mouse class provides methods to emulate mouse input

Hierarchy

  • Mouse

Index

Constructors

constructor

Methods

drag

  • drag drags the mouse along a certain path In summary, drag presses and holds the left mouse button, moves the mouse and releases the left button

    Parameters

    Returns Promise<Mouse>

getPosition

  • getPosition(): Promise<Point>

leftClick

  • leftClick(): Promise<Mouse>

move

  • move(path: Point[] | Promise<Point[]>, movementType?: linear): Promise<Mouse>
  • move moves the mouse cursor along a given path of Points, according to a movement type

    Parameters

    • path: Point[] | Promise<Point[]>

      Array of Points to follow

    • Default value movementType: linear = linear

      Defines the type of mouse movement. Would allow to configured acceleration etc. (Default: linear, no acceleration)

    Returns Promise<Mouse>

pressButton

releaseButton

rightClick

  • rightClick(): Promise<Mouse>

scrollDown

  • scrollDown(amount: number): Promise<Mouse>
  • scrollDown scrolls down for a given amount of "steps" Please note that the actual scroll distance of a single "step" is OS dependent

    Parameters

    • amount: number

      The amount of "steps" to scroll

    Returns Promise<Mouse>

scrollLeft

  • scrollLeft(amount: number): Promise<Mouse>
  • scrollLeft scrolls left for a given amount of "steps" Please note that the actual scroll distance of a single "step" is OS dependent

    Parameters

    • amount: number

      The amount of "steps" to scroll

    Returns Promise<Mouse>

scrollRight

  • scrollRight(amount: number): Promise<Mouse>
  • scrollRight scrolls right for a given amount of "steps" Please note that the actual scroll distance of a single "step" is OS dependent

    Parameters

    • amount: number

      The amount of "steps" to scroll

    Returns Promise<Mouse>

scrollUp

  • scrollUp(amount: number): Promise<Mouse>
  • scrollUp scrolls up for a given amount of "steps" Please note that the actual scroll distance of a single "step" is OS dependent

    Parameters

    • amount: number

      The amount of "steps" to scroll

    Returns Promise<Mouse>

setPosition

Object literals

config

config: object

Config object for Mouse class

autoDelayMs

autoDelayMs: number = 100

Configures the delay between single mouse events

mouseSpeed

mouseSpeed: number = 1000

Configures the speed in pixels/second for mouse movement