InputSimulator.Latur
1.0.2
dotnet add package InputSimulator.Latur --version 1.0.2
NuGet\Install-Package InputSimulator.Latur -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InputSimulator.Latur" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="InputSimulator.Latur" Version="1.0.2" />
<PackageReference Include="InputSimulator.Latur" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add InputSimulator.Latur --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: InputSimulator.Latur, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package InputSimulator.Latur@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=InputSimulator.Latur&version=1.0.2
#tool nuget:?package=InputSimulator.Latur&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
๐ InputSimulator
InputSimulator is a lightweight C# library for simulating low-level keyboard and mouse input using SendInput, with support for:
- Key presses/releases (including modifiers)
- Mouse button actions
- Smooth or delta-based human-like mouse movement
- Absolute mouse positioning
๐ ๏ธ Features
- โ Full virtual keycode map (letters, digits, modifiers, OEM keys, etc.)
- ๐ฑ๏ธ Mouse click and movement support (LButton, RButton, MButton, XButton1, XButton2)
- ๐ง Smooth delta-based mouse movement with adjustable speed and easing
- ๐ง Utility methods for cursor repositioning and held-modifier tracking
๐ฆ Installation
Include the two source files in your C# project:
Interop.csโ low-level WinAPI definitionsSimulator.csโ main interaction interface
No external dependencies required. Fully P/Invoke-based.
๐ Usage
Initialize
var sim = new InputSimulator.Simulator();
๐ก Send Keyboard or Mouse Input
sim.Send("A"); // Press and release 'A'
sim.Send("Ctrl down"); // Hold down Ctrl
sim.Send("C"); // Press and release 'C' while Ctrl is held
sim.Send("Ctrl up"); // Release Ctrl
sim.Send("LButton"); // Left mouse click
sim.Send("RButton down"); // Right mouse down
sim.Send("RButton up"); // Right mouse up
๐ฏ Move Mouse to Absolute Position
sim.MouseSetPos(100, 200); // Instantly move mouse to (100, 200)
๐งญ Smooth Human-Like Delta Mouse Movement
sim.MouseDeltaMove(800, 500); // Move to (800, 500) smoothly
sim.MouseDeltaMove(800, 500, 2.0); // Move faster (speed multiplier)
sim.MouseDeltaMove(800, 500, 0.5); // Move slower
This creates a natural motion path with easing and sine-wave curvature to simulate human input.
๐ก Internals
- Input is sent using
SendInputWinAPI. - Keyboard and mouse events are translated into
INPUTstructs. MouseDeltaMove()calculates interpolated paths and sends delta updates to mimic physical movement.- Supports all standard virtual key codes from A-Z, 0-9, F1-F24, symbols, media keys, browser keys, and more.
๐ KeyMap Reference
The KeyMap dictionary includes mappings for:
- Mouse:
LButton,RButton,MButton,XButton1,XButton2 - Control:
Ctrl,Shift,Alt,Esc,Enter, etc. - Alphabet:
AtoZ - Digits:
0to9,Num0toNum9 - Function:
F1toF24 - OEM keys:
;,=,-,/, etc. - Media/browser keys:
MediaPlayPause,VolumeUp,BrowserBack, etc.
๐ Notes & Limitations
- The library is intended for local user simulation โ not remote desktop or sandboxed environments.
- It uses unmanaged code (P/Invoke), so full trust is required.
- Some games with anti-cheat mechanisms may block or detect
SendInput.
โ Example: Simulate Copy-Paste Shortcut
var sim = new InputSimulator.Simulator();
sim.Send("Ctrl down");
sim.Send("C");
sim.Send("Ctrl up");
๐งช Example: Human-Like Drag to Screen Center
// Wait 1 second, then move mouse to center of 1920x1080 screen
Thread.Sleep(1000);
sim.MouseDeltaMove(960, 540, speed: 1.2);
๐ License
MIT License
| 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 was computed. 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 was computed. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.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.