Class KeyboardSimulator
A keyboard event simulator, which can simulate KeyDown
, KeyUp
, and KeyPress
events.
public static class KeyboardSimulator
- Inheritance
-
KeyboardSimulator
- Inherited Members
Methods
KeyDown(Keys)
Simulates a KeyDown
event..
public static bool KeyDown(Keys key)
Parameters
key
KeysThe key to simulate.
Returns
KeyPress(Keys)
Simulates a KeyPress
event..
public static bool KeyPress(Keys key)
Parameters
key
KeysThe key to simulate.
Returns
Remarks
A KeyPress
event consists of a KeyDown
event, followed by a short delay, then a KeyUp
event.
KeyPressAsync(Keys)
Simulates a KeyPress
event..
public static Task<bool> KeyPressAsync(Keys key)
Parameters
key
KeysThe key to simulate.
Returns
Remarks
A KeyPress
event consists of a KeyDown
event, followed by a short delay, then a KeyUp
event.
This method uses an awaitable Task to create the delay between KeyDown
and KeyUp
events.
KeyUp(Keys)
Simulates a KeyUp
event..
public static bool KeyUp(Keys key)
Parameters
key
KeysThe key to simulate.