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" />
                    
Directory.Packages.props
<PackageReference Include="InputSimulator.Latur" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=InputSimulator.Latur&version=1.0.2
                    
Install as a Cake Tool

๐Ÿ“˜ 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 definitions
  • Simulator.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 SendInput WinAPI.
  • Keyboard and mouse events are translated into INPUT structs.
  • 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: A to Z
  • Digits: 0 to 9, Num0 to Num9
  • Function: F1 to F24
  • 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 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.

Version Downloads Last Updated
1.0.2 214 7/30/2025
1.0.1 170 7/30/2025