Input.dispatchMouseEvent

Dispatches a mouse event to the page.

{
  "name": "dispatchMouseEvent",
  "parameters": [
    {
      "name": "type",
      "type": "string",
      "enum": [
        "mousePressed",
        "mouseReleased",
        "mouseMoved"
      ],
      "description": "Type of the mouse event."
    },
    {
      "name": "x",
      "type": "integer",
      "description": "X coordinate of the event relative to the main frame's viewport."
    },
    {
      "name": "y",
      "type": "integer",
      "description": "Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."
    },
    {
      "name": "modifiers",
      "type": "integer",
      "optional": true,
      "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)."
    },
    {
      "name": "timestamp",
      "type": "number",
      "optional": true,
      "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)."
    },
    {
      "name": "button",
      "type": "string",
      "enum": [
        "none",
        "left",
        "middle",
        "right"
      ],
      "optional": true,
      "description": "Mouse button (default: \"none\")."
    },
    {
      "name": "clickCount",
      "type": "integer",
      "optional": true,
      "description": "Number of times the mouse button was clicked (default: 0)."
    }
  ],
  "description": "Dispatches a mouse event to the page.",
  "handlers": [
    "browser"
  ]
}