Input
No symbols match your filter.
Commands
Input.dispatchDragEvent
Experimental Dispatches a drag event into the page.
Parameters
| Name | Type | Description |
|---|---|---|
type
|
string |
Type of the drag event. |
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. |
data
|
DragData |
|
modifiers
(optional) |
integer |
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). |
Input.dispatchKeyEvent
Dispatches a key event to the page.
Parameters
| Name | Type | Description |
|---|---|---|
type
|
string |
Type of the key event. |
modifiers
(optional) |
integer |
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). |
timestamp
(optional) |
TimeSinceEpoch |
Time at which the event occurred. |
text
(optional) |
string |
Text as generated by processing a virtual key code with a keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events (default: "") |
unmodifiedText
(optional) |
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
(optional) |
string |
Unique key identifier (e.g., 'U+0041') (default: ""). |
code
(optional) |
string |
Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: ""). |
key
(optional) |
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
(optional) |
integer |
Windows virtual key code (default: 0). |
nativeVirtualKeyCode
(optional) |
integer |
Native virtual key code (default: 0). |
autoRepeat
(optional) |
boolean |
Whether the event was generated from auto repeat (default: false). |
isKeypad
(optional) |
boolean |
Whether the event was generated from the keypad (default: false). |
isSystemKey
(optional) |
boolean |
Whether the event was a system key event (default: false). |
location
(optional) |
integer |
Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0). |
commands
(optional) Experimental |
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. |
Input.insertText
Experimental This method emulates inserting text that doesn't come from a key press,
for example an emoji keyboard or an IME.
Parameters
| Name | Type | Description |
|---|---|---|
text
|
string |
The text to insert. |
Input.imeSetComposition
Experimental This method sets the current candidate text for IME.
Use imeCommitComposition to commit the final text.
Use imeSetComposition with empty string as text to cancel composition.
Parameters
| Name | Type | Description |
|---|---|---|
text
|
string |
The text to insert |
selectionStart
|
integer |
selection start |
selectionEnd
|
integer |
selection end |
replacementStart
(optional) |
integer |
replacement start |
replacementEnd
(optional) |
integer |
replacement end |
Input.dispatchMouseEvent
Dispatches a mouse event to the page.
Parameters
| Name | Type | Description |
|---|---|---|
type
|
string |
Type of the mouse event. |
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
(optional) |
integer |
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). |
timestamp
(optional) |
TimeSinceEpoch |
Time at which the event occurred. |
button
(optional) |
MouseButton |
Mouse button (default: "none"). |
buttons
(optional) |
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
(optional) |
integer |
Number of times the mouse button was clicked (default: 0). |
force
(optional) Experimental |
number |
The normalized pressure, which has a range of [0,1] (default: 0). |
tangentialPressure
(optional) Experimental |
number |
The normalized tangential pressure, which has a range of [-1,1] (default: 0). |
tiltX
(optional) |
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
(optional) |
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
(optional) Experimental |
integer |
The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). |
deltaX
(optional) |
number |
X delta in CSS pixels for mouse wheel event (default: 0). |
deltaY
(optional) |
number |
Y delta in CSS pixels for mouse wheel event (default: 0). |
pointerType
(optional) |
string |
Pointer type (default: "mouse"). |
Input.dispatchTouchEvent
Dispatches a touch event to the page.
Parameters
| Name | Type | Description |
|---|---|---|
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. |
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
(optional) |
integer |
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). |
timestamp
(optional) |
TimeSinceEpoch |
Time at which the event occurred. |
Input.cancelDragging
Cancels any active dragging in the page.
Input.emulateTouchFromMouseEvent
Experimental Emulates touch event from the mouse event parameters.
Parameters
| Name | Type | Description |
|---|---|---|
type
|
string |
Type of the mouse event. |
x
|
integer |
X coordinate of the mouse pointer in DIP. |
y
|
integer |
Y coordinate of the mouse pointer in DIP. |
button
|
MouseButton |
Mouse button. Only "none", "left", "right" are supported. |
timestamp
(optional) |
TimeSinceEpoch |
Time at which the event occurred (default: current time). |
deltaX
(optional) |
number |
X delta in DIP for mouse wheel event (default: 0). |
deltaY
(optional) |
number |
Y delta in DIP for mouse wheel event (default: 0). |
modifiers
(optional) |
integer |
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). |
clickCount
(optional) |
integer |
Number of times the mouse button was clicked (default: 0). |
Input.setIgnoreInputEvents
Ignores input events (useful while auditing page).
Parameters
| Name | Type | Description |
|---|---|---|
ignore
|
boolean |
Ignores input events processing when set to true. |
Input.setInterceptDrags
Experimental Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.
Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`.
Parameters
| Name | Type | Description |
|---|---|---|
enabled
|
boolean |
Input.synthesizePinchGesture
Experimental Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
Parameters
| Name | Type | Description |
|---|---|---|
x
|
number |
X coordinate of the start of the gesture in CSS pixels. |
y
|
number |
Y coordinate of the start of the gesture in CSS pixels. |
scaleFactor
|
number |
Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out). |
relativeSpeed
(optional) |
integer |
Relative pointer speed in pixels per second (default: 800). |
gestureSourceType
(optional) |
GestureSourceType |
Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). |
Input.synthesizeScrollGesture
Experimental Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
Parameters
| Name | Type | Description |
|---|---|---|
x
|
number |
X coordinate of the start of the gesture in CSS pixels. |
y
|
number |
Y coordinate of the start of the gesture in CSS pixels. |
xDistance
(optional) |
number |
The distance to scroll along the X axis (positive to scroll left). |
yDistance
(optional) |
number |
The distance to scroll along the Y axis (positive to scroll up). |
xOverscroll
(optional) |
number |
The number of additional pixels to scroll back along the X axis, in addition to the given distance. |
yOverscroll
(optional) |
number |
The number of additional pixels to scroll back along the Y axis, in addition to the given distance. |
preventFling
(optional) |
boolean |
Prevent fling (default: true). |
speed
(optional) |
integer |
Swipe speed in pixels per second (default: 800). |
gestureSourceType
(optional) |
GestureSourceType |
Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). |
repeatCount
(optional) |
integer |
The number of times to repeat the gesture (default: 0). |
repeatDelayMs
(optional) |
integer |
The number of milliseconds delay between each repeat. (default: 250). |
interactionMarkerName
(optional) |
string |
The name of the interaction markers to generate, if not empty (default: ""). |
Input.synthesizeTapGesture
Experimental Synthesizes a tap gesture over a time period by issuing appropriate touch events.
Parameters
| Name | Type | Description |
|---|---|---|
x
|
number |
X coordinate of the start of the gesture in CSS pixels. |
y
|
number |
Y coordinate of the start of the gesture in CSS pixels. |
duration
(optional) |
integer |
Duration between touchdown and touchup events in ms (default: 50). |
tapCount
(optional) |
integer |
Number of times to perform the tap (e.g. 2 for double tap, default: 1). |
gestureSourceType
(optional) |
GestureSourceType |
Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). |
Events
Input.dragIntercepted
Experimental Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to
restore normal drag and drop behavior.
Parameters
| Name | Type | Description |
|---|---|---|
data
|
DragData |
Types
TouchPoint
(object)
Properties
| Name | Type | Description |
|---|---|---|
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
(optional) |
number |
X radius of the touch area (default: 1.0). |
radiusY
(optional) |
number |
Y radius of the touch area (default: 1.0). |
rotationAngle
(optional) |
number |
Rotation angle (default: 0.0). |
force
(optional) |
number |
Force (default: 1.0). |
tangentialPressure
(optional) Experimental |
number |
The normalized tangential pressure, which has a range of [-1,1] (default: 0). |
tiltX
(optional) |
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
(optional) |
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
(optional) Experimental |
integer |
The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). |
id
(optional) |
number |
Identifier used to track touch sources between events, must be unique within an event. |
GestureSourceType
(string)
Experimental Allowed Values
defaulttouchmouse
MouseButton
(string)
Allowed Values
noneleftmiddlerightbackforward
TimeSinceEpoch
(number)
UTC time in seconds, counted from January 1, 1970.
DragDataItem
(object)
Experimental Properties
| Name | Type | Description |
|---|---|---|
mimeType
|
string |
Mime type of the dragged data. |
data
|
string |
Depending of the value of `mimeType`, it contains the dragged link, text, HTML markup or any other data. |
title
(optional) |
string |
Title associated with a link. Only valid when `mimeType` == "text/uri-list". |
baseURL
(optional) |
string |
Stores the base URL for the contained markup. Only valid when `mimeType` == "text/html". |
DragData
(object)
Experimental Properties
| Name | Type | Description |
|---|---|---|
items
|
array<DragDataItem> |
|
files
(optional) |
array<string> |
List of filenames that should be included when dropping |
dragOperationsMask
|
integer |
Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 |