Table of Contents

Class MouseSimulator

Namespace
NetEx.Hooks
Assembly
NetEx.Hooks.dll

A mouse event simulator, which can simulate MouseClick, MouseDoubleClick, MouseDown, MouseUp, MouseMove, and MouseWheel events.

public static class MouseSimulator
Inheritance
MouseSimulator
Inherited Members

Methods

MouseClick(MouseButtons)

Simulates a MouseClick event..

public static bool MouseClick(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

bool

true if the event was sent successfully; otherwise

Remarks

A MouseClick event consists of a MouseDown event, followed by a short delay, then a MouseUp event.

MouseClickAsync(MouseButtons)

Simulates a MouseClick event..

public static Task<bool> MouseClickAsync(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

Task<bool>

true if the event was sent successfully; otherwise

Remarks

A MouseClick event consists of a MouseDown event, followed by a short delay, then a MouseUp event.

This method uses an awaitable Task to create the delay between MouseDown and MouseUp events.

MouseDoubleClick(MouseButtons)

Simulates a MouseDoubleClick event..

public static bool MouseDoubleClick(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

bool

true if the event was sent successfully; otherwise

Remarks

A MouseDoubleClick event consists of a MouseClick event, followed by a delay 1ms shorter than the allowed double-click time (as defined by the operating system), then another MouseClick event.

MouseDoubleClickAsync(MouseButtons)

Simulates a MouseDoubleClick event..

public static Task<bool> MouseDoubleClickAsync(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

Task<bool>

true if the event was sent successfully; otherwise

Remarks

A MouseDoubleClick event consists of a MouseClick event, followed by a delay 1ms shorter than the allowed double-click time (as defined by the operating system), then another MouseClick event.

This method uses an awaitable Task to create the delay between MouseClick events.

MouseDown(MouseButtons)

Simulates a MouseDown event..

public static bool MouseDown(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

bool

true if the event was sent successfully; otherwise

MouseMove(Point)

Simulates a MouseMove event using Absolute coordinate mapping.

public static bool MouseMove(Point location)

Parameters

location Point

The location to simulator moving the mouse cursor to.

Returns

bool

true if the event was sent successfully; otherwise

MouseMove(Point, MouseCoordinateMapping)

Simulates a MouseMove event..

public static bool MouseMove(Point location, MouseCoordinateMapping mouseCoordinateMapping)

Parameters

location Point

The location to simulator moving the mouse cursor to.

mouseCoordinateMapping MouseCoordinateMapping

Defines how the specified location is applied relative to the current mouse cursor location.

Returns

bool

true if the event was sent successfully; otherwise

MouseUp(MouseButtons)

Simulates a MouseUp event..

public static bool MouseUp(MouseButtons mouseButton)

Parameters

mouseButton MouseButtons

The mouse button to simulate.

Returns

bool

true if the event was sent successfully; otherwise

MouseWheel(int)

Simulates a MouseWheel event..

public static bool MouseWheel(int delta)

Parameters

delta int

The mouse wheel increment to simulate.

Returns

bool

true if the event was sent successfully; otherwise