Interface IMouse
- Namespace
- PuppeteerSharp.Input
- Assembly
- PuppeteerSharp.dll
Provides methods to interact with the mouse.
public interface IMouse : IDisposable
Methods
ClickAsync(decimal, decimal, ClickOptions)
Shortcut for MoveAsync(decimal, decimal, MoveOptions), DownAsync(ClickOptions) and UpAsync(ClickOptions).
Task ClickAsync(decimal x, decimal y, ClickOptions options = null)
Parameters
xdecimalThe target mouse X location to click.
ydecimalThe target mouse Y location to click.
optionsClickOptionsOptions to apply to the click operation.
Returns
- Task
Task.
DownAsync(ClickOptions)
Dispatches a mousedown event.
Task DownAsync(ClickOptions options = null)
Parameters
optionsClickOptionsOptions to apply to the mouse down operation.
Returns
- Task
Task.
DragAndDropAsync(decimal, decimal, decimal, decimal, int)
Performs a drag, dragenter, dragover, and drop in sequence.
Task DragAndDropAsync(decimal startX, decimal startY, decimal endX, decimal endY, int delay = 0)
Parameters
startXdecimalStart X coordinate.
startYdecimalStart Y coordinate.
endXdecimalEnd X coordinate.
endYdecimalEnd Y coordinate.
delayintIf specified, is the time to wait between
dragoveranddropin milliseconds.
Returns
- Task
A Task that resolves when the message was confirmed by the browser.
DragAsync(decimal, decimal, decimal, decimal)
Dispatches a drag event.
Task<DragData> DragAsync(decimal startX, decimal startY, decimal endX, decimal endY)
Parameters
startXdecimalStart X coordinate.
startYdecimalStart Y coordinate.
endXdecimalEnd X coordinate.
endYdecimalEnd Y coordinate.
Returns
- Task<DragData>
A Task that resolves when the message was confirmed by the browser with the drag data.
DragEnterAsync(decimal, decimal, DragData)
Dispatches a dragenter event.
Task DragEnterAsync(decimal x, decimal y, DragData data)
Parameters
xdecimalx coordinate.
ydecimaly coordinate.
dataDragDataDrag data containing items and operations mask.
Returns
- Task
A Task that resolves when the message was confirmed by the browser.
DragOverAsync(decimal, decimal, DragData)
Dispatches a dragover event.
Task DragOverAsync(decimal x, decimal y, DragData data)
Parameters
xdecimalx coordinate.
ydecimaly coordinate.
dataDragDataDrag data containing items and operations mask.
Returns
- Task
A Task that resolves when the message was confirmed by the browser.
DropAsync(decimal, decimal, DragData)
Dispatches a drop event.
Task DropAsync(decimal x, decimal y, DragData data)
Parameters
xdecimalx coordinate.
ydecimaly coordinate.
dataDragDataDrag data containing items and operations mask.
Returns
- Task
A Task that resolves when the message was confirmed by the browser.
MoveAsync(decimal, decimal, MoveOptions)
Dispatches a mousemove event.
Task MoveAsync(decimal x, decimal y, MoveOptions options = null)
Parameters
xdecimalThe destination mouse X coordinate.
ydecimalThe destination mouse Y coordinate.
optionsMoveOptionsOptions to apply to the move operation.
Returns
- Task
Task.
ResetAsync()
Resets the mouse to the default state: No buttons pressed; position at (0,0).
Task ResetAsync()
Returns
- Task
Task.
UpAsync(ClickOptions)
Dispatches a mouseup event.
Task UpAsync(ClickOptions options = null)
Parameters
optionsClickOptionsOptions to apply to the mouse up operation.
Returns
- Task
Task.
WheelAsync(decimal, decimal)
Dispatches a wheel event.
Task WheelAsync(decimal deltaX, decimal deltaY)
Parameters
Returns
- Task
Task.