tot: Input
Contents
Commands
Input.dispatchKeyEvent
request: {
"id": <number>,
"method": "Input.dispatchKeyEvent",
"params": {
"type": <string>,
"modifiers": <integer>,
"timestamp": <number>,
"text": <string>,
"unmodifiedText": <string>,
"keyIdentifier": <string>,
"windowsVirtualKeyCode": <integer>,
"nativeVirtualKeyCode": <integer>,
"macCharCode": <integer>,
"autoRepeat": <boolean>,
"isKeypad": <boolean>,
"isSystemKey": <boolean>
}
"id": <number>,
"error": <object>
"id": <number>,
"method": "Input.dispatchKeyEvent",
"params": {
"type": <string>,
"modifiers": <integer>,
"timestamp": <number>,
"text": <string>,
"unmodifiedText": <string>,
"keyIdentifier": <string>,
"windowsVirtualKeyCode": <integer>,
"nativeVirtualKeyCode": <integer>,
"macCharCode": <integer>,
"autoRepeat": <boolean>,
"isKeypad": <boolean>,
"isSystemKey": <boolean>
}
}
response: {"id": <number>,
"error": <object>
}
Dispatches a key event to the page.
Parameters
type
(
enumerated
string
[
"char"
,
"keyDown"
,
"keyUp"
,
"rawKeyDown"
]
)
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
number
)
Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
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: "").
windowsVirtualKeyCode
(
optional
integer
)
Windows virtual key code (default: 0).
nativeVirtualKeyCode
(
optional
integer
)
Native virtual key code (default: 0).
macCharCode
(
optional
integer
)
Mac character 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).
Input.dispatchMouseEvent
request: {
"id": <number>,
"method": "Input.dispatchMouseEvent",
"params": {
"type": <string>,
"x": <integer>,
"y": <integer>,
"modifiers": <integer>,
"timestamp": <number>,
"button": <string>,
"clickCount": <integer>
}
"id": <number>,
"error": <object>
"id": <number>,
"method": "Input.dispatchMouseEvent",
"params": {
"type": <string>,
"x": <integer>,
"y": <integer>,
"modifiers": <integer>,
"timestamp": <number>,
"button": <string>,
"clickCount": <integer>
}
}
response: {"id": <number>,
"error": <object>
}
Dispatches a mouse event to the page.
Parameters
type
(
enumerated
string
[
"mouseMoved"
,
"mousePressed"
,
"mouseReleased"
]
)
Type of the mouse event.
x
(
integer
)
X coordinate of the event relative to the main frame's viewport.
y
(
integer
)
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.
modifiers
(
optional
integer
)
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
timestamp
(
optional
number
)
Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
button
(
optional
enumerated
string
[
"left"
,
"middle"
,
"none"
,
"right"
]
)
Mouse button (default: "none").
clickCount
(
optional
integer
)
Number of times the mouse button was clicked (default: 0).