Table of Contents

Class KeyboardSimulator

Namespace
NetEx.Hooks
Assembly
NetEx.Hooks.dll

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 Keys

The key to simulate.

Returns

bool

true if the event was sent successfully; otherwise

KeyPress(Keys)

Simulates a KeyPress event..

public static bool KeyPress(Keys key)

Parameters

key Keys

The key to simulate.

Returns

bool

true if the event was sent successfully; otherwise

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 Keys

The key to simulate.

Returns

Task<bool>

true if both events were sent successfully; otherwise

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 Keys

The key to simulate.

Returns

bool

true if the event was sent successfully; otherwise