H.InputSimulatorUnityCompatibility
1.0.0
dotnet add package H.InputSimulatorUnityCompatibility --version 1.0.0
NuGet\Install-Package H.InputSimulatorUnityCompatibility -Version 1.0.0
<PackageReference Include="H.InputSimulatorUnityCompatibility" Version="1.0.0" />
<PackageVersion Include="H.InputSimulatorUnityCompatibility" Version="1.0.0" />
<PackageReference Include="H.InputSimulatorUnityCompatibility" />
paket add H.InputSimulatorUnityCompatibility --version 1.0.0
#r "nuget: H.InputSimulatorUnityCompatibility, 1.0.0"
#addin nuget:?package=H.InputSimulatorUnityCompatibility&version=1.0.0
#tool nuget:?package=H.InputSimulatorUnityCompatibility&version=1.0.0
H.InputSimulator
Allows you to simulate global mouse and keyboard events. Features:
- Supports scan codes and multi-language input.
- Supports WPF/WinForms/Console windows apps.
- Supports .NET Standard 2.0+, .Net Framework 4.6.2 and .Net 8+.
- Supports trimming/nativeAOT, nullability, and other modern C# features.
Supported OS:
- Windows
Nuget
Install-Package H.InputSimulator
Examples
SelectCopyPaste
new InputSimulator().Keyboard
.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_A)
.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_C)
.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
OpenWindowsExplorer
new InputSimulator().Keyboard
.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_E);
SelfDestructMessage
new InputSimulator().Keyboard
.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R)
.Sleep(1000)
.TextEntry("notepad")
.Sleep(1000)
.KeyPress(VirtualKeyCode.RETURN)
.Sleep(1000)
.TextEntry("These are your orders if you choose to accept them...")
.TextEntry("This message will self destruct in 5 seconds.")
.Sleep(5000)
.ModifiedKeyStroke(VirtualKeyCode.MENU, VirtualKeyCode.F4)
.KeyPress(VirtualKeyCode.VK_N);
OpenPaintAndCreateLine
new InputSimulator().Keyboard
.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R)
.Sleep(1000)
.TextEntry("mspaint")
.Sleep(1000)
.KeyPress(VirtualKeyCode.RETURN)
.Sleep(1000)
.Mouse
.LeftButtonDown()
.MoveMouseToPositionOnVirtualDesktop(65535 / 2, 65535 / 2)
.LeftButtonUp();
Common problems
Some simulated input commands were not sent successfully.
Please think of the library as a high-level wrapper over Win32 SendInput
call.
Unfortunately, this is a limitation of the API itself, according to this documentation:
- https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput#remarks
- https://en.wikipedia.org/wiki/User_Interface_Privilege_Isolation
The easiest way to get around this is to run your application as an administrator.
Support
Priority place for bugs: https://github.com/HavenDV/H.InputSimulator/issues
Priority place for ideas and general questions: https://github.com/HavenDV/H.InputSimulator/discussions
I also have a Discord support channel:
https://discord.gg/g8u2t9dKgE
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Memory (>= 4.5.4)
-
.NETStandard 2.0
- System.Memory (>= 4.5.4)
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 174 | 3/10/2025 |