Skip to content

Ukine9999/HumanizedMouseMove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HumanizedMouseMove (HMM)

A .NET library for creating human-like mouse movements with configurable smoothing algorithms and customizable behavior patterns.

Overview

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.

Features

  • 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

Project Structure

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

Core Components

HMM.Core

The main entry point that handles dependency injection setup and service initialization. Automatically discovers and loads mouse movement modules.

HMM.MouseMove.Abstraction

Defines the core interfaces for mouse movement functionality:

  • IMouseController: Main interface for controlling mouse movements
  • IMouseMoveProvider: Interface for getting/setting mouse positions
  • IMouseMoveSmoothProvider: Interface for generating smooth movement paths
  • Vector2: Simple 2D vector structure for coordinates

HMM.MouseMove

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

Smoothing Algorithms

Linear Smoothing

Provides straight-line interpolation between start and end points with configurable step count.

Curved Smoothing

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

Configuration Options

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

Usage Example

// 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 });

Dependencies

  • 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

Building

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 Release

Architecture

The 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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Implement your changes
  4. Add appropriate tests
  5. Submit a pull request

Requirements

  • .NET Framework 4.8 or later
  • Visual Studio 2019+ or compatible IDE
  • C# 9.0+ (preview language version)

Support

For issues, questions, or contributions, please use the project's issue tracker or contact me.

About

C# library to humanization mouse movement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages