Mouse
Namespace: PuppeteerSharp.Input
public abstract class Mouse : IMouse, IDisposableSupports 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.
Inheritance: object
Implements: IMouse, IDisposable
Derived: CdpMouse
Methods
Section titled “Methods”ClickAsync(decimal, decimal, ClickOptions)
Section titled “ClickAsync(decimal, decimal, ClickOptions)”public abstract Task ClickAsync(decimal x, decimal y, ClickOptions options = null)Shortcut for MoveOptions), DownAsync(ClickOptions) and UpAsync(ClickOptions).
Parameters
| Name | Type | Description |
|---|---|---|
x |
decimal | The target mouse X location to click. |
y |
decimal | The target mouse Y location to click. |
options |
ClickOptions | Options to apply to the click operation. |
Returns: Task — Task.
Dispose()
Section titled “Dispose()”public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Dispose(bool)
Section titled “Dispose(bool)”protected abstract void Dispose(bool disposing)Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Parameters
| Name | Type | Description |
|---|---|---|
disposing |
bool |
DownAsync(ClickOptions)
Section titled “DownAsync(ClickOptions)”public abstract Task DownAsync(ClickOptions options = null)Dispatches a mousedown event.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ClickOptions | Options to apply to the mouse down operation. |
Returns: Task — Task.
DragAndDropAsync(decimal, decimal, decimal, decimal, int)
Section titled “DragAndDropAsync(decimal, decimal, decimal, decimal, int)”public abstract Task DragAndDropAsync(decimal startX, decimal startY, decimal endX, decimal endY, int delay = 0)Performs a drag, dragenter, dragover, and drop in sequence.
Parameters
| Name | Type | Description |
|---|---|---|
startX |
decimal | Start X coordinate. |
startY |
decimal | Start Y coordinate. |
endX |
decimal | End X coordinate. |
endY |
decimal | End Y coordinate. |
delay |
int | If specified, is the time to wait between dragover and drop in milliseconds. |
Returns: Task — A Task that resolves when the message was confirmed by the browser.
DragAsync(decimal, decimal, decimal, decimal)
Section titled “DragAsync(decimal, decimal, decimal, decimal)”public abstract Task<DragData> DragAsync(decimal startX, decimal startY, decimal endX, decimal endY)Dispatches a drag event.
Parameters
| Name | Type | Description |
|---|---|---|
startX |
decimal | Start X coordinate. |
startY |
decimal | Start Y coordinate. |
endX |
decimal | End X coordinate. |
endY |
decimal | End 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)
Section titled “DragEnterAsync(decimal, decimal, DragData)”public abstract Task DragEnterAsync(decimal x, decimal y, DragData data)Dispatches a dragenter event.
Parameters
| Name | Type | Description |
|---|---|---|
x |
decimal | x coordinate. |
y |
decimal | y coordinate. |
data |
DragData | Drag data containing items and operations mask. |
Returns: Task — A Task that resolves when the message was confirmed by the browser.
DragOverAsync(decimal, decimal, DragData)
Section titled “DragOverAsync(decimal, decimal, DragData)”public abstract Task DragOverAsync(decimal x, decimal y, DragData data)Dispatches a dragover event.
Parameters
| Name | Type | Description |
|---|---|---|
x |
decimal | x coordinate. |
y |
decimal | y coordinate. |
data |
DragData | Drag data containing items and operations mask. |
Returns: Task — A Task that resolves when the message was confirmed by the browser.
DropAsync(decimal, decimal, DragData)
Section titled “DropAsync(decimal, decimal, DragData)”public abstract Task DropAsync(decimal x, decimal y, DragData data)Dispatches a drop event.
Parameters
| Name | Type | Description |
|---|---|---|
x |
decimal | x coordinate. |
y |
decimal | y coordinate. |
data |
DragData | Drag data containing items and operations mask. |
Returns: Task — A Task that resolves when the message was confirmed by the browser.
MoveAsync(decimal, decimal, MoveOptions)
Section titled “MoveAsync(decimal, decimal, MoveOptions)”public abstract Task MoveAsync(decimal x, decimal y, MoveOptions options = null)Dispatches a mousemove event.
Parameters
| Name | Type | Description |
|---|---|---|
x |
decimal | The destination mouse X coordinate. |
y |
decimal | The destination mouse Y coordinate. |
options |
MoveOptions | Options to apply to the move operation. |
Returns: Task — Task.
ResetAsync()
Section titled “ResetAsync()”public abstract Task ResetAsync()Resets the mouse to the default state: No buttons pressed; position at (0,0).
Returns: Task — Task.
UpAsync(ClickOptions)
Section titled “UpAsync(ClickOptions)”public abstract Task UpAsync(ClickOptions options = null)Dispatches a mouseup event.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ClickOptions | Options to apply to the mouse up operation. |
Returns: Task — Task.
WheelAsync(decimal, decimal)
Section titled “WheelAsync(decimal, decimal)”public abstract Task WheelAsync(decimal deltaX, decimal deltaY)Dispatches a wheel event.
Parameters
| Name | Type | Description |
|---|---|---|
deltaX |
decimal | Delta X. |
deltaY |
decimal | Delta Y. |
Returns: Task — Task.
Made with love by Dario Kondratiuk