Class Mouse
- Namespace
- PuppeteerSharp.Input
- Assembly
- PuppeteerSharp.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public abstract class Mouse : IMouse, IDisposable
- Inheritance
-
Mouse
- Implements
- Derived
Methods
ClickAsync(decimal, decimal, ClickOptions)
Shortcut for MoveAsync(decimal, decimal, MoveOptions), DownAsync(ClickOptions) and UpAsync(ClickOptions).
public abstract Task ClickAsync(decimal x, decimal y, ClickOptions options = null)
Parameters
x
decimalThe target mouse X location to click.
y
decimalThe target mouse Y location to click.
options
ClickOptionsOptions to apply to the click operation.
Returns
- Task
Task.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected abstract void Dispose(bool disposing)
Parameters
disposing
bool
DownAsync(ClickOptions)
Dispatches a mousedown
event.
public abstract Task DownAsync(ClickOptions options = null)
Parameters
options
ClickOptionsOptions 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.
public abstract Task DragAndDropAsync(decimal startX, decimal startY, decimal endX, decimal endY, int delay = 0)
Parameters
startX
decimalStart X coordinate.
startY
decimalStart Y coordinate.
endX
decimalEnd X coordinate.
endY
decimalEnd Y coordinate.
delay
intIf specified, is the time to wait between
dragover
anddrop
in milliseconds.
Returns
- Task
A Task that resolves when the message was confirmed by the browser.
DragAsync(decimal, decimal, decimal, decimal)
Dispatches a drag
event.
public abstract Task<DragData> DragAsync(decimal startX, decimal startY, decimal endX, decimal endY)
Parameters
startX
decimalStart X coordinate.
startY
decimalStart Y coordinate.
endX
decimalEnd X coordinate.
endY
decimalEnd 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.
public abstract Task DragEnterAsync(decimal x, decimal y, DragData data)
Parameters
x
decimalx coordinate.
y
decimaly coordinate.
data
DragDataDrag 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.
public abstract Task DragOverAsync(decimal x, decimal y, DragData data)
Parameters
x
decimalx coordinate.
y
decimaly coordinate.
data
DragDataDrag 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.
public abstract Task DropAsync(decimal x, decimal y, DragData data)
Parameters
x
decimalx coordinate.
y
decimaly coordinate.
data
DragDataDrag 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.
public abstract Task MoveAsync(decimal x, decimal y, MoveOptions options = null)
Parameters
x
decimalThe destination mouse X coordinate.
y
decimalThe destination mouse Y coordinate.
options
MoveOptionsOptions to apply to the move operation.
Returns
- Task
Task.
ResetAsync()
Resets the mouse to the default state: No buttons pressed; position at (0,0).
public abstract Task ResetAsync()
Returns
- Task
Task.
UpAsync(ClickOptions)
Dispatches a mouseup
event.
public abstract Task UpAsync(ClickOptions options = null)
Parameters
options
ClickOptionsOptions to apply to the mouse up operation.
Returns
- Task
Task.
WheelAsync(decimal, decimal)
Dispatches a wheel
event.
public abstract Task WheelAsync(decimal deltaX, decimal deltaY)
Parameters
Returns
- Task
Task.