KeyMouseHook 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package KeyMouseHook --version 1.0.0                
NuGet\Install-Package KeyMouseHook -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.
<PackageReference Include="KeyMouseHook" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KeyMouseHook --version 1.0.0                
#r "nuget: KeyMouseHook, 1.0.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 KeyMouseHook as a Cake Addin
#addin nuget:?package=KeyMouseHook&version=1.0.0

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

nuget stable build license platforms

Keyboard and Mouse Hooking and Simulator Library in c#(winform)

What it does?

This is a extension library use globalmousekeyhook and InputSimulator.it allows you to tap keyboard and mouse, to detect and record their activity event when an application is inactive and runs in background.The Windows Input Simulator provides a simple .NET(C#) interface to simulate Keyboard or Mouse input using the Win32 SendInput method.

Prerequisites

  • Windows: .Net Framework 4.6+

Installation and sources

nuget install KeyMouseHook

Usage

private readonly KeyMouseFactory eventHookFactory = new KeyMouseFactory(HookType.GlobalEvents);
private readonly KeyboardWatcher keyboardWatcher;
private readonly MouseWatcher mouseWatcher;
private List<MouseKeyEvent> _mouseKeyEvents;

public FormMain()
{
   InitializeComponent();

   keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
   keyboardWatcher.OnKeyboardInput += (s, e) =>
   {
	if (_mouseKeyEvents != null)
	    _mouseKeyEvents.Add(e);
   };

   mouseWatcher = eventHookFactory.GetMouseWatcher();
   mouseWatcher.OnMouseInput += (s, e) =>
   {
	if (_mouseKeyEvents != null)
	    _mouseKeyEvents.Add(e);
   };
}

public void StartWatch(IKeyboardMouseEvents events = null)
{
    _macroEvents = new List<MacroEvent>();
    keyboardWatcher.Start(events);
    mouseWatcher.Start(events);
}

public void StopWatch()
{
   keyboardWatcher.Stop();
   mouseWatcher.Stop();
}

private void Playback()
{
   var sim = new InputSimulator();
   //var sim = new KeyMouseSimulator();
   sim.PlayBack(_macroEvents);
}

Screen Shots

Keyboard and Mouse Hooking and Simulator Library in c#(winform)

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on KeyMouseHook:

Repository Stars
BookerLiu/GeekDesk
🔥小巧、美观的桌面快速启动工具 Small, beautiful desktop quickstart management tool with integrated Everything search
CXWorld/CapFrameX
Frametime capture and analysis tool
KaustubhPatange/Kling
A utility to show keyboard keys visually on the Windows screen.
Version Downloads Last updated
1.0.6 6,866 12/7/2018
1.0.5 789 11/26/2018
1.0.4 774 11/15/2018
1.0.3 793 11/12/2018
1.0.2 842 11/9/2018
1.0.1 784 11/8/2018
1.0.0 808 11/8/2018