Skip to content
Discussion options

You must be logged in to vote

The NuGet package ID is H.InputSimulator, but the public C# namespace is still WindowsInput for compatibility. Replace the using directive with:

using WindowsInput;

var simulator = new InputSimulator();
simulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);

The current package project explicitly sets RootNamespace to WindowsInput (project file), and InputSimulator plus VirtualKeyCode are declared directly in that namespace (InputSimulator, VirtualKeyCode). A package name does not have to match its namespaces.

If using WindowsInput; is also unresolved, verify that the package was installed into the same project that contains this source file rather than another project in the solution:

dotne…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Trihy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants