Simulate keyboard input in C#

后端 未结 8 2112
逝去的感伤
逝去的感伤 2020-12-02 12:47

I need to know how to simulate keyboard input for keys W, S, A, D.

I\'ve used SendKeys with no avai

8条回答
  •  独厮守ぢ
    2020-12-02 13:09

    Windows Input Simulator makes this super easy.

    The Windows Input Simulator provides a simple .NET (C#) interface to simulate Keyboard or Mouse input using the Win32 SendInput method. All of the Interop is done for you and there's a simple programming model for sending multiple keystrokes. Nuget package -> Install-Package InputSimulator

    https://inputsimulator.codeplex.com/

提交回复
热议问题