Repository navigation
|
Hi. Sorry for the noob question, but I was trying to migrate from inputsimulator to H.Inputsimulator. And when referencing in C# using H.InputSimulator; i get The type or namespace name 'H' could not be found (are you missing a using directive or an assembly reference?) Package was correctly installed from nuget. Am I missing something? Thanks |
Replies: 2 comments
|
The NuGet package ID is using WindowsInput;
var simulator = new InputSimulator();
simulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);The current package project explicitly sets If dotnet list path/to/YourProject.csproj packageYou should see |
|
Thanks. That worked, I was using using WindowsInput.Native; that was causing incosistence. BTW do you think anything can be done for working on UAC yes/no prompts? From what I read it wont be possible. |
The NuGet package ID is
H.InputSimulator, but the public C# namespace is stillWindowsInputfor compatibility. Replace the using directive with:The current package project explicitly sets
RootNamespacetoWindowsInput(project file), andInputSimulatorplusVirtualKeyCodeare 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: