Class InputGenerator
This is a utility class to help to generate input for mouse and keyboard
Inheritance
Namespace: Dapplo.Windows.Input
Assembly: Dapplo.Windows.Input.dll
Syntax
public static class InputGenerator : object
Methods
| Improve this Doc View SourceKeyDown(VirtualKeyCodes[])
Generate key down
Declaration
public static uint KeyDown(params VirtualKeyCodes[] keycodes)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes[] | keycodes | VirtualKeyCodes for the key downs |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
KeyPress(VirtualKeyCodes[])
Generate key press(es)
Declaration
public static uint KeyPress(params VirtualKeyCodes[] keycodes)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes[] | keycodes | params VirtualKeyCodes |
Returns
Type | Description |
---|---|
System.UInt32 |
KeyUp(VirtualKeyCodes[])
Generate key(s) up
Declaration
public static uint KeyUp(params VirtualKeyCodes[] keycodes)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes[] | keycodes | VirtualKeyCodes for the keys to release |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
MouseClick(MouseButtons, Nullable<POINT>, UInt32)
Generate mouse button(s) click
Declaration
public static uint MouseClick(MouseButtons mouseButtons, POINT? location = null, uint timestamp = null)
Parameters
Type | Name | Description |
---|---|---|
MouseButtons | mouseButtons | MouseButtons specifying which buttons are pressed |
System.Nullable<POINT> | location | optional POINT to specify where the mouse click takes place |
System.UInt32 | timestamp | The time stamp for the event |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
MouseDown(MouseButtons, Nullable<POINT>, UInt32)
Generate mouse button(s) down
Declaration
public static uint MouseDown(MouseButtons mouseButtons, POINT? location = null, uint timestamp = null)
Parameters
Type | Name | Description |
---|---|---|
MouseButtons | mouseButtons | MouseButtons specifying which buttons are down |
System.Nullable<POINT> | location | optional POINT to specify where the mouse down takes place |
System.UInt32 | timestamp | The time stamp for the event |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
MouseUp(MouseButtons, Nullable<POINT>, UInt32)
Generate mouse button(s) Up
Declaration
public static uint MouseUp(MouseButtons mouseButtons, POINT? location = null, uint timestamp = null)
Parameters
Type | Name | Description |
---|---|---|
MouseButtons | mouseButtons | MouseButtons specifying which buttons are up |
System.Nullable<POINT> | location | optional POINT to specify where the mouse up takes place |
System.UInt32 | timestamp | The time stamp for the event |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
MoveMouse(POINT, UInt32)
Generate mouse wheel moves
Declaration
public static uint MoveMouse(POINT location, uint timestamp = null)
Parameters
Type | Name | Description |
---|---|---|
POINT | location | POINT to specify where the mouse moves |
System.UInt32 | timestamp | The time stamp for the event |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |
MoveMouseWheel(Int32, Nullable<POINT>, UInt32)
Generate mouse wheel moves
Declaration
public static uint MoveMouseWheel(int wheelDelta, POINT? location = null, uint timestamp = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | wheelDelta | |
System.Nullable<POINT> | location | optional POINT to specify where the mouse wheel takes place |
System.UInt32 | timestamp | The time stamp for the event |
Returns
Type | Description |
---|---|
System.UInt32 | number of input events generated |