Desktop.Robot 1.5.0

dotnet add package Desktop.Robot --version 1.5.0                
NuGet\Install-Package Desktop.Robot -Version 1.5.0                
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="Desktop.Robot" Version="1.5.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Desktop.Robot --version 1.5.0                
#r "nuget: Desktop.Robot, 1.5.0"                
#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.
// Install Desktop.Robot as a Cake Addin
#addin nuget:?package=Desktop.Robot&version=1.5.0

// Install Desktop.Robot as a Cake Tool
#tool nuget:?package=Desktop.Robot&version=1.5.0                

<p align="center"> <img src="Resources/logo.png" width="300px"> </p> <p align="center"> <a href="https://www.nuget.org/packages/Desktop.Robot"><img alt="nuget" src="https://img.shields.io/nuget/dt/Desktop.Robot.svg"></a> <a href="https://www.codacy.com/gh/lucassklp/Desktop.Robot/dashboard?utm_source=github.com&utm_medium=referral&utm_content=lucassklp/Desktop.Robot&utm_campaign=Badge_Grade"> <img src="https://app.codacy.com/project/badge/Grade/985f1cdd1034486cbb00a3fd3e4fff19"/> </a> <a href="https://www.nuget.org/packages/Desktop.Robot"><img alt="nuget version" src="https://img.shields.io/nuget/v/Desktop.Robot.svg"></a> </p>

Desktop.Robot

This library helps you to automate tasks by simulating inputs (mouse and keyboards) programmatically, inspired in java.awt.Robot

I made this library because the dotnet SDK doesn't support simulation of mouse and keyboard input. The only way of input simulation in the standard framework is by using Windows.Forms which won't run on Linux or OSX.

Installation

If you are using Package Manager:

Install-Package Desktop.Robot -Version 1.5.0

If you are using .NET CLI

dotnet add package Desktop.Robot --version 1.5.0

Advantages

  • Multiplatform: works on Windows, Linux and OSX
  • Built using the Operating System Native and .NET API, other dependencies needed
  • Easy to use

Example of use

using Desktop.Robot;
using Desktop.Robot.Extensions;
namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            var robot = new Robot();
            robot.AutoDelay = 1000;
            robot.MouseMove(100, 100);
            robot.Click();
            robot.Type("A invisible cat is using my PC");
        }
    }
}

Remarks

In order to use the method CreateScreenCapture you will need to install some libraries. This is required by System.Drawing's components

Installing the requirements on Linux

sudo apt install libgdiplus

Current limitations

  1. As we are currently developing this tool, multiple monitors are not supported for now.
  2. The library is under development, and some methods will throw a NotImplementedException
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Desktop.Robot:

Repository Stars
lucassklp/Desktop.Robot
A library used to control your mouse and keyboard programmatically in .NET Core
Version Downloads Last updated
1.5.0 50,992 7/10/2023
1.4.1 196 7/3/2023
1.4.0 162 6/27/2023
1.3.2 4,885 9/10/2022
1.3.1 55,142 12/20/2021
1.3.0 339 12/19/2021
1.2.4 469 11/7/2021
1.2.3 392 11/6/2021
1.2.3-alpha 218 11/6/2021
1.2.2-alpha 226 8/24/2021
1.2.1 697 6/13/2021
1.1.1 453 5/22/2021
1.1.0 376 5/21/2021
1.0.0 367 5/11/2021
1.0.0-alpha 508 1/30/2021