Input 1.0.0

.NET Standard 2.1
There is a newer version of this package available.
See the version list below for details.
NuGet\Install-Package Input -Version 1.0.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.
dotnet add package Input --version 1.0.0
<PackageReference Include="Input" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Input --version 1.0.0
#r "nuget: Input, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Input as a Cake Addin
#addin nuget:?package=Input&version=1.0.0

// Install Input as a Cake Tool
#tool nuget:?package=Input&version=1.0.0

Input

멀티 플랫폼 키보드 및 마우스 후킹, 입력

📖 Wiki

Input 위키

input.test

API 사용 테스트 도구입니다.

📚 Samples

더 많은 샘플은 Example에서 확인할 수 있습니다.

Hook

키보드 및 마우스 후킹 예제입니다.

  • ⌨️ Keyboard Hook

    using Input;
    using System.Diagnostics;
    using Input.Platforms.Windows;
    
    var hook = Inputs.Use<IKeyboardHook>();
    var model = hook.KeyboardModel;
    
    model.KeyDown += (sender, key, state) => {
      Debug.WriteLine($"KeyDown: {key} {state}");
      return true;
    };
    
    model.KeyUp += (sender, key, state) => {
      Debug.WriteLine($"KeyDown: {key} {state}");
      return true;
    };
    
    hook.HookStart();
    
    if (Platform.IsWindows)
      while (WindowsMessagePump.Pumping()) { }
    
    Console.ReadLine();
    

    자세한 예제는 여기에서 확인할 수 있습니다.

  • 🖱️ Mouse Hook

    using Input;
    using Input.Platforms.Windows;
    using System.Diagnostics;
    
    var hook = Inputs.Use<IKeyboardHook>();
    var model = hook.KeyboardModel;
    
    model.KeyDown += (sender, key, state) => {
        Debug.WriteLine($"KeyDown: {key} {state}");
        return true;
    };
    
    model.KeyUp += (sender, key, state) => {
        Debug.WriteLine($"KeyDown: {key} {state}");
        return true;
    };
    
    hook.HookStart();
    
    if (Platform.IsWindows)
      while (WindowsMessagePump.Pumping()) { }
    
    Console.ReadLine();
    

    자세한 예제는 여기에서 확인할 수 있습니다.

Simulation

키보드 및 마우스 시뮬레이션 예제입니다.

  • ⌨️ Keyboard Simulation

    using Input;
    using System.Diagnostics;
    
    var simulation = Inputs.Use<IKeyboardSimulation>();
    
    // 1.1 KeyClick
    
    simulation.KeyClick(InputKeys.A);
    
    simulation.KeyClick(InputKeys.LeftControl, InputKeys.Z);
    
    // 1.2 KeyDown
    
    simulation.KeyDown(InputKeys.A);
    
    simulation.KeyDown(InputKeys.A, InputKeys.B);
    
    // 1.3 KeyUp
    
    simulation.KeyUp(InputKeys.A);
    
    simulation.KeyUp(InputKeys.A, InputKeys.B);
    
    // 1.4 TextEntry
    
    simulation.TextEntry("Hello, World!");
    
    // 1.5 IsKeyDown
    
    simulation.IsKeyDown(InputKeys.A);
    
    // 1.6 ReleaseAllKeys
    
    simulation.ReleaseAllKeys();
    

    자세한 예제는 여기에서 확인할 수 있습니다.

  • 🖱️ Mouse Simulation

    using Input;
    using System.Diagnostics;
    
    var simulation = Inputs.Use<IMouseSimulation>();
    
    simulation.Debug = true;
    
    // 1.1 Click
    
    simulation.Click();
    
    simulation.Click(10, 10);
    
    simulation.Click(InputMouseButtons.Right);
    
    simulation.Click(InputMouseButtons.Right, 10, 10);
    
    simulation.AbsoluteClick(100, 100);
    
    simulation.AbsoluteClick(InputMouseButtons.Right, 100, 100);
    
    // 1.2 Down
    
    simulation.Down(InputMouseButtons.Left);
    
    simulation.Down(InputMouseButtons.Left, 10, 10);
    
    simulation.AbsoluteDown(InputMouseButtons.Left, 100, 100);
    
    // 1.3 Up
    
    simulation.Up(InputMouseButtons.Left);
    
    simulation.Up(InputMouseButtons.Left, 10, 10);
    
    simulation.AbsoluteUp(InputMouseButtons.Left, 100, 100);
    
    // 1.4 Move
    
    simulation.Move(10, 10);
    
    simulation.AbsoluteMove(100, 100);
    
    // 1.5 Scroll
    
    simulation.Scroll(1);
    simulation.ScrollUp(1);
    
    simulation.Scroll(-1);
    simulation.ScrollDown(1);
    
    // 1.6 Mouse State
    
    simulation.GetMousePosition(out var x, out var y);
    
    simulation.IsMouseDown(InputMouseButtons.Left);
    

    자세한 예제는 여기에서 확인할 수 있습니다.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.1
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • 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.3 87 7/29/2022
1.0.2 97 6/6/2022
1.0.1 187 12/7/2021
1.0.0 118 12/7/2021