Interface IEventSimulator
Represents an object which can simulate keyboard and mouse events.
Namespace: SharpHook
Assembly: SharpHook.dll
Syntax
public interface IEventSimulator
Remarks
The methods of this interface correspond to constants defined in the EventType enum.
Methods
| Improve this Doc View SourceSimulateKeyPress(KeyCode)
Simulates pressing a key.
Declaration
UioHookResult SimulateKeyPress(KeyCode keyCode)
Parameters
Type | Name | Description |
---|---|---|
KeyCode | keyCode | The code of the key to press. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SimulateKeyRelease(KeyCode)
Simulates releasing a key.
Declaration
UioHookResult SimulateKeyRelease(KeyCode keyCode)
Parameters
Type | Name | Description |
---|---|---|
KeyCode | keyCode | The code of the key to release. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SimulateMouseMovement(Int16, Int16)
Simulates moving a mouse pointer.
Declaration
UioHookResult SimulateMouseMovement(short x, short y)
Parameters
Type | Name | Description |
---|---|---|
Int16 | x | The target X-coordinate of the mouse pointer. |
Int16 | y | The target Y-coordinate of the mouse pointer. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SimulateMousePress(Int16, Int16, MouseButton)
Simulates pressing a mouse button at the specified coordinates.
Declaration
UioHookResult SimulateMousePress(short x, short y, MouseButton button)
Parameters
Type | Name | Description |
---|---|---|
Int16 | x | The target X-coordinate of the mouse pointer. |
Int16 | y | The target Y-coordinate of the mouse pointer. |
MouseButton | button | The mouse button to press. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SimulateMouseRelease(Int16, Int16, MouseButton)
Simulates releasing a mouse button at the specified coordinates.
Declaration
UioHookResult SimulateMouseRelease(short x, short y, MouseButton button)
Parameters
Type | Name | Description |
---|---|---|
Int16 | x | The target X-coordinate of the mouse pointer. |
Int16 | y | The target Y-coordinate of the mouse pointer. |
MouseButton | button | The mouse button to release. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
SimulateMouseWheel(Int16, Int16, UInt16, Int16)
Simulates scrolling the mouse wheel at the specified coordinates.
Declaration
UioHookResult SimulateMouseWheel(short x, short y, ushort amount, short rotation)
Parameters
Type | Name | Description |
---|---|---|
Int16 | x | The target X-coordinate of the mouse pointer. |
Int16 | y | The target Y-coordinate of the mouse pointer. |
UInt16 | amount | The scrolling amount. |
Int16 | rotation | The wheel rotation. |
Returns
Type | Description |
---|---|
UioHookResult | The result of the operation. |
Remarks
A positive rotation
value indicates that the wheel will be rotated down and a negative value
indicates that the wheel will be rotated up.