← Back to Input domain

Input.emulateTouchFromMouseEvent

Emulates touch event from the mouse event parameters.

Domain: Input experimental

Parameters

NameTypeDescription
typestringType of the mouse event.
xintegerX coordinate of the mouse pointer in DIP.
yintegerY coordinate of the mouse pointer in DIP.
buttonMouseButtonMouse button. Only "none", "left", "right" are supported.
timestamp (optional)TimeSinceEpochTime at which the event occurred (default: current time).
deltaX (optional)numberX delta in DIP for mouse wheel event (default: 0).
deltaY (optional)numberY delta in DIP for mouse wheel event (default: 0).
modifiers (optional)integerBit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
clickCount (optional)integerNumber of times the mouse button was clicked (default: 0).

Example Request

{
  "id": 1,
  "method": "Input.emulateTouchFromMouseEvent",
  "params": {
    "type": "type-value",
    "x": 100,
    "y": 100,
    "button": "button-value"
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Input.emulateTouchFromMouseEvent', {"type": "type-value", "x": 100, "y": 100, "button": "button-value"});
console.log(result);