A .NET library for creating human-like mouse movements with configurable smoothing algorithms and customizable behavior patterns.
HumanizedMouseMove is designed to simulate natural mouse cursor movements by implementing various smoothing algorithms that make automated mouse movements appear more human-like. This is particularly useful for automation tools, testing frameworks, or any application where realistic mouse behavior is required.
- Multiple Smoothing Algorithms: Linear and curved mouse movement patterns
- Configurable Parameters: Adjustable speed, delay, and smoothing intensity
- Dependency Injection Ready: Built with modern DI patterns for easy integration
- Extensible Architecture: Plugin-based system for custom movement providers
- Cross-Platform: Built on .NET Framework 4.8 with modern C# features
src/
├── HMM.Core/ # Core application logic and DI container
├── HMM.Initializing.Abstraction/ # Initialization interfaces
├── HMM.MouseMove.Abstraction/ # Core mouse movement interfaces
├── HMM.MouseMove/ # Mouse movement implementations
The main entry point that handles dependency injection setup and service initialization. Automatically discovers and loads mouse movement modules.
Defines the core interfaces for mouse movement functionality:
IMouseController: Main interface for controlling mouse movementsIMouseMoveProvider: Interface for getting/setting mouse positionsIMouseMoveSmoothProvider: Interface for generating smooth movement pathsVector2: Simple 2D vector structure for coordinates
Implements the concrete mouse movement providers:
- MouseController: Main controller that orchestrates mouse movements
- LinearMouseMoveSmoothProvider: Generates linear interpolation paths
- CurvedMouseMoveSmoothProvider: Generates curved Bezier-based paths with natural deviation
Provides straight-line interpolation between start and end points with configurable step count.
Uses quadratic Bezier curves to create natural-looking curved paths with:
- Configurable deviation angles (5° to 25°)
- Random or fixed deviation direction
- Adjustable intensity for natural movement variation
The MouseController supports several configurable parameters:
- Smooth: Enable/disable smoothing (default: true)
- Delay: Milliseconds between movement steps (default: 50ms)
- Speed: Movement speed factor (default: 0.1)
- MouseMoveProvider: Custom mouse position provider
- SmoothProvider: Custom smoothing algorithm provider
// Create the core application
var core = HMMCore.Create();
// Get the mouse controller
var mouseController = core.Provider.ResolveService<IMouseController>();
// Configure movement parameters
mouseController.Smooth = true;
mouseController.Delay = 30;
mouseController.Speed = 0.2f;
// Move mouse to absolute position
await mouseController.MoveTo(new Vector2 { X = 500, Y = 300 });
// Move mouse by relative offset
await mouseController.Move(new Vector2 { X = 100, Y = -50 });- DI.Engine.Attributes (v1.0.6): Dependency injection engine
- DI.Services.Scheme.Attributes (v1.0.6): Service scheme management
- .NET Framework 4.8: Target framework
The project uses MSBuild with the following configuration:
# Build Debug configuration
dotnet build HMM.sln --configuration Debug
# Build Release configuration
dotnet build HMM.sln --configuration ReleaseThe project follows a clean architecture pattern with:
- Abstraction Layer: Interfaces defining contracts
- Implementation Layer: Concrete implementations
- Dependency Injection: Automatic service discovery and registration
- Plugin System: Modular architecture for extensibility
- Fork the repository
- Create a feature branch
- Implement your changes
- Add appropriate tests
- Submit a pull request
- .NET Framework 4.8 or later
- Visual Studio 2019+ or compatible IDE
- C# 9.0+ (preview language version)
For issues, questions, or contributions, please use the project's issue tracker or contact me.