Input

class Input(cdp: CDP) : Domain

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class DispatchDragEventParameter(val type: String, val x: Double, val y: Double, val data: Input.DragData, val modifiers: Int? = null)
Link copied to clipboard
@Serializable
data class DispatchKeyEventParameter(val type: String, val modifiers: Int? = null, val timestamp: Double? = null, val text: String? = null, val unmodifiedText: String? = null, val keyIdentifier: String? = null, val code: String? = null, val key: String? = null, val windowsVirtualKeyCode: Int? = null, val nativeVirtualKeyCode: Int? = null, val autoRepeat: Boolean? = null, val isKeypad: Boolean? = null, val isSystemKey: Boolean? = null, val location: Int? = null, val commands: List<String>? = null)
Link copied to clipboard
@Serializable
data class DispatchMouseEventParameter(val type: String, val x: Double, val y: Double, val modifiers: Int? = null, val timestamp: Double? = null, val button: Input.MouseButton? = null, val buttons: Int? = null, val clickCount: Int? = null, val force: Double? = null, val tangentialPressure: Double? = null, val tiltX: Double? = null, val tiltY: Double? = null, val twist: Int? = null, val deltaX: Double? = null, val deltaY: Double? = null, val pointerType: String? = null)
Link copied to clipboard
@Serializable
data class DispatchTouchEventParameter(val type: String, val touchPoints: List<Input.TouchPoint>, val modifiers: Int? = null, val timestamp: Double? = null)
Link copied to clipboard
@Serializable
data class DragData(val items: List<Input.DragDataItem>, val files: List<String>? = null, val dragOperationsMask: Int)
Link copied to clipboard
@Serializable
data class DragDataItem(val mimeType: String, val data: String, val title: String? = null, val baseURL: String? = null)
Link copied to clipboard
@Serializable
data class DragInterceptedParameter(val data: Input.DragData)

Emitted only when Input.setInterceptDrags is enabled. Use this data with Input.dispatchDragEvent to restore normal drag and drop behavior.

Link copied to clipboard
@Serializable
data class EmulateTouchFromMouseEventParameter(val type: String, val x: Int, val y: Int, val button: Input.MouseButton, val timestamp: Double? = null, val deltaX: Double? = null, val deltaY: Double? = null, val modifiers: Int? = null, val clickCount: Int? = null)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class ImeSetCompositionParameter(val text: String, val selectionStart: Int, val selectionEnd: Int, val replacementStart: Int? = null, val replacementEnd: Int? = null)
Link copied to clipboard
@Serializable
data class InsertTextParameter(val text: String)
Link copied to clipboard
@Serializable
enum MouseButton : Enum<Input.MouseButton>
Link copied to clipboard
@Serializable
data class SetIgnoreInputEventsParameter(val ignore: Boolean)
Link copied to clipboard
@Serializable
data class SetInterceptDragsParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SynthesizePinchGestureParameter(val x: Double, val y: Double, val scaleFactor: Double, val relativeSpeed: Int? = null, val gestureSourceType: Input.GestureSourceType? = null)
Link copied to clipboard
@Serializable
data class SynthesizeScrollGestureParameter(val x: Double, val y: Double, val xDistance: Double? = null, val yDistance: Double? = null, val xOverscroll: Double? = null, val yOverscroll: Double? = null, val preventFling: Boolean? = null, val speed: Int? = null, val gestureSourceType: Input.GestureSourceType? = null, val repeatCount: Int? = null, val repeatDelayMs: Int? = null, val interactionMarkerName: String? = null)
Link copied to clipboard
@Serializable
data class SynthesizeTapGestureParameter(val x: Double, val y: Double, val duration: Int? = null, val tapCount: Int? = null, val gestureSourceType: Input.GestureSourceType? = null)
Link copied to clipboard
@Serializable
data class TouchPoint(val x: Double, val y: Double, val radiusX: Double? = null, val radiusY: Double? = null, val rotationAngle: Double? = null, val force: Double? = null, val tangentialPressure: Double? = null, val tiltX: Double? = null, val tiltY: Double? = null, val twist: Int? = null, val id: Double? = null)

Properties

Link copied to clipboard

Emitted only when Input.setInterceptDrags is enabled. Use this data with Input.dispatchDragEvent to restore normal drag and drop behavior.

Functions

Link copied to clipboard
suspend fun cancelDragging(mode: CommandMode = CommandMode.DEFAULT)

Cancels any active dragging in the page.

Link copied to clipboard
suspend fun dispatchDragEvent(args: Input.DispatchDragEventParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun dispatchDragEvent(type: String, x: Double, y: Double, data: Input.DragData, modifiers: Int? = null)

Dispatches a drag event into the page.

Link copied to clipboard
suspend fun dispatchKeyEvent(args: Input.DispatchKeyEventParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun dispatchKeyEvent(type: String, modifiers: Int? = null, timestamp: Double? = null, text: String? = null, unmodifiedText: String? = null, keyIdentifier: String? = null, code: String? = null, key: String? = null, windowsVirtualKeyCode: Int? = null, nativeVirtualKeyCode: Int? = null, autoRepeat: Boolean? = null, isKeypad: Boolean? = null, isSystemKey: Boolean? = null, location: Int? = null, commands: List<String>? = null)

Dispatches a key event to the page.

Link copied to clipboard
suspend fun dispatchMouseEvent(args: Input.DispatchMouseEventParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun dispatchMouseEvent(type: String, x: Double, y: Double, modifiers: Int? = null, timestamp: Double? = null, button: Input.MouseButton? = null, buttons: Int? = null, clickCount: Int? = null, force: Double? = null, tangentialPressure: Double? = null, tiltX: Double? = null, tiltY: Double? = null, twist: Int? = null, deltaX: Double? = null, deltaY: Double? = null, pointerType: String? = null)

Dispatches a mouse event to the page.

Link copied to clipboard
suspend fun dispatchTouchEvent(args: Input.DispatchTouchEventParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun dispatchTouchEvent(type: String, touchPoints: List<Input.TouchPoint>, modifiers: Int? = null, timestamp: Double? = null)

Dispatches a touch event to the page.

Link copied to clipboard
suspend fun emulateTouchFromMouseEvent(type: String, x: Int, y: Int, button: Input.MouseButton, timestamp: Double? = null, deltaX: Double? = null, deltaY: Double? = null, modifiers: Int? = null, clickCount: Int? = null)

Emulates touch event from the mouse event parameters.

Link copied to clipboard
suspend fun imeSetComposition(args: Input.ImeSetCompositionParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun imeSetComposition(text: String, selectionStart: Int, selectionEnd: Int, replacementStart: Int? = null, replacementEnd: Int? = null)

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.

Link copied to clipboard
suspend fun insertText(text: String)
suspend fun insertText(args: Input.InsertTextParameter, mode: CommandMode = CommandMode.DEFAULT)

This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.

Link copied to clipboard
suspend fun setIgnoreInputEvents(ignore: Boolean)
suspend fun setIgnoreInputEvents(args: Input.SetIgnoreInputEventsParameter, mode: CommandMode = CommandMode.DEFAULT)

Ignores input events (useful while auditing page).

Link copied to clipboard
suspend fun setInterceptDrags(enabled: Boolean)
suspend fun setInterceptDrags(args: Input.SetInterceptDragsParameter, mode: CommandMode = CommandMode.DEFAULT)

Prevents default drag and drop behavior and instead emits Input.dragIntercepted events. Drag and drop behavior can be directly controlled via Input.dispatchDragEvent.

Link copied to clipboard
suspend fun synthesizePinchGesture(args: Input.SynthesizePinchGestureParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun synthesizePinchGesture(x: Double, y: Double, scaleFactor: Double, relativeSpeed: Int? = null, gestureSourceType: Input.GestureSourceType? = null)

Synthesizes a pinch gesture over a time period by issuing appropriate touch events.

Link copied to clipboard
suspend fun synthesizeScrollGesture(args: Input.SynthesizeScrollGestureParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun synthesizeScrollGesture(x: Double, y: Double, xDistance: Double? = null, yDistance: Double? = null, xOverscroll: Double? = null, yOverscroll: Double? = null, preventFling: Boolean? = null, speed: Int? = null, gestureSourceType: Input.GestureSourceType? = null, repeatCount: Int? = null, repeatDelayMs: Int? = null, interactionMarkerName: String? = null)

Synthesizes a scroll gesture over a time period by issuing appropriate touch events.

Link copied to clipboard
suspend fun synthesizeTapGesture(args: Input.SynthesizeTapGestureParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun synthesizeTapGesture(x: Double, y: Double, duration: Int? = null, tapCount: Int? = null, gestureSourceType: Input.GestureSourceType? = null)

Synthesizes a tap gesture over a time period by issuing appropriate touch events.