Class InputAdapter
Represents an adapter for the Input domain to simplify the command interface.
public class InputAdapter
- Inheritance
-
InputAdapter
- Inherited Members
Constructors
InputAdapter(IDevToolsSession)
Initializes a new instance of the InputAdapter class.
public InputAdapter(IDevToolsSession session)
Parameters
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
Methods
CancelDragging(CancelDraggingCommandSettings?, CancellationToken, int?, bool)
Cancels any active dragging in the page.
public Task<CancelDraggingCommandResponse?> CancelDragging(CancelDraggingCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandCancelDraggingCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
DispatchDragEvent(DispatchDragEventCommandSettings, CancellationToken, int?, bool)
Dispatches a drag event into the page.
public Task<DispatchDragEventCommandResponse?> DispatchDragEvent(DispatchDragEventCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDispatchDragEventCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
DispatchKeyEvent(DispatchKeyEventCommandSettings, CancellationToken, int?, bool)
Dispatches a key event to the page.
public Task<DispatchKeyEventCommandResponse?> DispatchKeyEvent(DispatchKeyEventCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDispatchKeyEventCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
DispatchMouseEvent(DispatchMouseEventCommandSettings, CancellationToken, int?, bool)
Dispatches a mouse event to the page.
public Task<DispatchMouseEventCommandResponse?> DispatchMouseEvent(DispatchMouseEventCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDispatchMouseEventCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
DispatchTouchEvent(DispatchTouchEventCommandSettings, CancellationToken, int?, bool)
Dispatches a touch event to the page.
public Task<DispatchTouchEventCommandResponse?> DispatchTouchEvent(DispatchTouchEventCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDispatchTouchEventCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
EmulateTouchFromMouseEvent(EmulateTouchFromMouseEventCommandSettings, CancellationToken, int?, bool)
Emulates touch event from the mouse event parameters.
public Task<EmulateTouchFromMouseEventCommandResponse?> EmulateTouchFromMouseEvent(EmulateTouchFromMouseEventCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandEmulateTouchFromMouseEventCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
ImeSetComposition(ImeSetCompositionCommandSettings, CancellationToken, int?, bool)
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.
public Task<ImeSetCompositionCommandResponse?> ImeSetComposition(ImeSetCompositionCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandImeSetCompositionCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
InsertText(InsertTextCommandSettings, CancellationToken, int?, bool)
This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.
public Task<InsertTextCommandResponse?> InsertText(InsertTextCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandInsertTextCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetIgnoreInputEvents(SetIgnoreInputEventsCommandSettings, CancellationToken, int?, bool)
Ignores input events (useful while auditing page).
public Task<SetIgnoreInputEventsCommandResponse?> SetIgnoreInputEvents(SetIgnoreInputEventsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetIgnoreInputEventsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetInterceptDrags(SetInterceptDragsCommandSettings, CancellationToken, int?, bool)
Prevents default drag and drop behavior and instead emits Input.dragIntercepted events.
Drag and drop behavior can be directly controlled via Input.dispatchDragEvent.
public Task<SetInterceptDragsCommandResponse?> SetInterceptDrags(SetInterceptDragsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetInterceptDragsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SynthesizePinchGesture(SynthesizePinchGestureCommandSettings, CancellationToken, int?, bool)
Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
public Task<SynthesizePinchGestureCommandResponse?> SynthesizePinchGesture(SynthesizePinchGestureCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSynthesizePinchGestureCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SynthesizeScrollGesture(SynthesizeScrollGestureCommandSettings, CancellationToken, int?, bool)
Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
public Task<SynthesizeScrollGestureCommandResponse?> SynthesizeScrollGesture(SynthesizeScrollGestureCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSynthesizeScrollGestureCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SynthesizeTapGesture(SynthesizeTapGestureCommandSettings, CancellationToken, int?, bool)
Synthesizes a tap gesture over a time period by issuing appropriate touch events.
public Task<SynthesizeTapGestureCommandResponse?> SynthesizeTapGesture(SynthesizeTapGestureCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSynthesizeTapGestureCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Events
DragIntercepted
Emitted only when Input.setInterceptDrags is enabled. Use this data with Input.dispatchDragEvent to
restore normal drag and drop behavior.
public event EventHandler<DragInterceptedEventArgs>? DragIntercepted