Jeremy
Jeremy

Reputation: 1835

Invoke keyboard event in c#

I have been googling FOREVER and I cannot figure out how to invoke keyboard events in C#. Can anyone help me please?

I am using an emulator for a game and I need to trigger keyboard events in my code. I am using WPF in Visual Studio

Upvotes: 3

Views: 866

Answers (1)

BrunoLM
BrunoLM

Reputation: 100331

You can use AutoIt3. After the install go to your project references and add:

\Program Files\AutoIt3\AutoItX\AutoItX3.dll

Then you can use its functions. The method to send keyboard keys is Send

AutoItX3Lib.IAutoItX3 a = new AutoItX3Lib.AutoItX3();

a.Send("{NUMPAD1}");

Related

Upvotes: 1

Related Questions