Methods
Input.dispatchKeyEvent #
Dispatches a key event to the page.
Parameters
type stringType of the key event.
Allowed values: keyDown, keyUp, rawKeyDown, char
modifiersOptional
integerBit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
timestampOptional
numberTime at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
textOptional
stringText as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")
unmodifiedTextOptional
stringText that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
keyIdentifierOptional
stringUnique key identifier (e.g., 'U+0041') (default: "").
codeOptional
stringUnique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
keyOptional
stringUnique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
windowsVirtualKeyCodeOptional
integerWindows virtual key code (default: 0).
nativeVirtualKeyCodeOptional
integerNative virtual key code (default: 0).
autoRepeatOptional
booleanWhether the event was generated from auto repeat (default: false).
isKeypadOptional
booleanWhether the event was generated from the keypad (default: false).
isSystemKeyOptional
booleanWhether the event was a system key event (default: false).
Input.dispatchMouseEvent #
Dispatches a mouse event to the page.
Parameters
type stringType of the mouse event.
Allowed values: mousePressed, mouseReleased, mouseMoved
x integerX coordinate of the event relative to the main frame's viewport.
y integerY 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.
modifiersOptional
integerBit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
timestampOptional
numberTime at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
buttonOptional
stringMouse button (default: "none").
Allowed values: none, left, middle, right
clickCountOptional
integerNumber of times the mouse button was clicked (default: 0).