Chrome DevTools Protocol

Methods

Input.cancelDragging

Cancels any active dragging in the page.

Input.dispatchKeyEvent

Dispatches a key event to the page.

parameters
type
string

Type of the key event.

Allowed Values: keyDown, keyUp, rawKeyDown, char
modifiers
integer

Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

timestamp
TimeSinceEpoch

Time at which the event occurred.

text
string

Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")

unmodifiedText
string

Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").

keyIdentifier
string

Unique key identifier (e.g., 'U+0041') (default: "").

code
string

Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").

key
string

Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").

windowsVirtualKeyCode
integer

Windows virtual key code (default: 0).

nativeVirtualKeyCode
integer

Native virtual key code (default: 0).

autoRepeat
boolean

Whether the event was generated from auto repeat (default: false).

isKeypad
boolean

Whether the event was generated from the keypad (default: false).

isSystemKey
boolean

Whether the event was a system key event (default: false).

location
integer

Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).

commands
array[ string ]

Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in document.execCommand and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.

Experimental

Input.dispatchMouseEvent

Dispatches a mouse event to the page.

parameters
type
string

Type of the mouse event.

Allowed Values: mousePressed, mouseReleased, mouseMoved, mouseWheel
x
number

X coordinate of the event relative to the main frame's viewport in CSS pixels.

y
number

Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.

modifiers
integer

Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

timestamp
TimeSinceEpoch

Time at which the event occurred.

button
MouseButton

Mouse button (default: "none").

buttons
integer

A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.

clickCount
integer

Number of times the mouse button was clicked (default: 0).

force
number

The normalized pressure, which has a range of [0,1] (default: 0).

Experimental
tangentialPressure
number

The normalized tangential pressure, which has a range of [-1,1] (default: 0).

Experimental
tiltX
number

The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).

tiltY
number

The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).

twist
integer

The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).

Experimental
deltaX
number

X delta in CSS pixels for mouse wheel event (default: 0).

deltaY
number

Y delta in CSS pixels for mouse wheel event (default: 0).

pointerType
string

Pointer type (default: "mouse").

Allowed Values: mouse, pen

Input.dispatchTouchEvent

Dispatches a touch event to the page.

parameters
type
string

Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.

Allowed Values: touchStart, touchEnd, touchMove, touchCancel
touchPoints
array[ TouchPoint ]

Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.

modifiers
integer

Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).

timestamp
TimeSinceEpoch

Time at which the event occurred.

Input.setIgnoreInputEvents

Ignores input events (useful while auditing page).

parameters
ignore
boolean

Ignores input events processing when set to true.

Types

Input.MouseButton

Allowed Values: none, left, middle, right, back, forward

Type: string

Input.TimeSinceEpoch

UTC time in seconds, counted from January 1, 1970.

Type: number

Input.TouchPoint

Type: object

properties
x
number

X coordinate of the event relative to the main frame's viewport in CSS pixels.

y
number

Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.

radiusX
number

X radius of the touch area (default: 1.0).

radiusY
number

Y radius of the touch area (default: 1.0).

rotationAngle
number

Rotation angle (default: 0.0).

force
number

Force (default: 1.0).

tangentialPressure
number

The normalized tangential pressure, which has a range of [-1,1] (default: 0).

Experimental
tiltX
number

The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0)

tiltY
number

The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).

twist
integer

The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).

Experimental
id
number

Identifier used to track touch sources between events, must be unique within an event.