XFE各类拓展.NetCore.InputSimulator 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package XFE各类拓展.NetCore.InputSimulator --version 1.0.1                
NuGet\Install-Package XFE各类拓展.NetCore.InputSimulator -Version 1.0.1                
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="XFE各类拓展.NetCore.InputSimulator" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XFE各类拓展.NetCore.InputSimulator --version 1.0.1                
#r "nuget: XFE各类拓展.NetCore.InputSimulator, 1.0.1"                
#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 XFE各类拓展.NetCore.InputSimulator as a Cake Addin
#addin nuget:?package=XFE各类拓展.NetCore.InputSimulator&version=1.0.1

// Install XFE各类拓展.NetCore.InputSimulator as a Cake Tool
#tool nuget:?package=XFE各类拓展.NetCore.InputSimulator&version=1.0.1                

XFE各类拓展.NetCore.InputSimulator

简介

InputSimulator是一个简单的模拟键盘输入的包,其中包含了模拟键盘按键输入和鼠标输入

用法

模拟键盘输入

using XFE各类拓展.NetCore.InputSimulator;

InputSimulator.PressKey('X');//按下X按键
InputSimulator.InputKeys("XFE");//顺序按下 X、F、E 按键

模拟鼠标移动

using XFE各类拓展.NetCore.InputSimulator;

InputSimulator.Move(100, 100);//使得鼠标从当前位置相对移动 100 x 100 个像素(相对于鼠标指针的当前位置)
InputSimulator.LocateTo(1900, 202);//使得鼠标移动至绝对坐标 1900,202 的位置处(相对于整个屏幕的位置)
InputSimulator.LocateTo(new Point(0, 0));//使得鼠标移动至绝对坐标(0, 0)的位置处(相对于整个屏幕的位置)
InputSimulator.LocateTo(ScreenPosition.TopLeft);//使得鼠标移动至屏幕的左上角,即(0, 0)的位置处(相对于整个屏幕的位置)

模拟鼠标点击

using XFE各类拓展.NetCore.InputSimulator;

InputSimulator.MouseClick(MouseButton.Left);//模拟鼠标左键点击

获取信息

using XFE各类拓展.NetCore.InputSimulator;

var screenSize = GetScreenSize();//获取屏幕的宽和高(像素)
var mousePoint = GetMousePosition();//获取鼠标的位置
var percentage = GetMousePointRelatively();//获取鼠标相对于屏幕的比值(范围是0-1的double型百分比)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.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.2.1 155 2/19/2024 1.2.1 is deprecated because it is no longer maintained.
1.2.0 140 1/2/2024
1.1.0 127 12/19/2023
1.0.2 126 12/19/2023
1.0.1 111 12/19/2023
1.0.0 102 12/19/2023

新增对模拟鼠标操作的支持