![]() |
VOOZH | about |
dotnet add package KeyMouseHook --version 1.0.6
NuGet\Install-Package KeyMouseHook -Version 1.0.6
<PackageReference Include="KeyMouseHook" Version="1.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageVersion Include="KeyMouseHook" Version="1.0.6" />Directory.Packages.props
<PackageReference Include="KeyMouseHook"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>Project file
paket add KeyMouseHook --version 1.0.6
#r "nuget: KeyMouseHook, 1.0.6"
#:package KeyMouseHook@1.0.6
#addin nuget:?package=KeyMouseHook&version=1.0.6Install as a Cake Addin
#tool nuget:?package=KeyMouseHook&version=1.0.6Install as a Cake Tool
π nuget
π stable
π build
π license
π download_count
π release
This is an extension to globalmousekeyhook and InputSimulator library which 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.
nuget install KeyMouseHook
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);
};
}
private void StartWatch(IKeyboardMouseEvents events = null)
{
_macroEvents = new List<MacroEvent>();
keyboardWatcher.Start(events);
mouseWatcher.Start(events);
}
private void StopWatch()
{
keyboardWatcher.Stop();
mouseWatcher.Stop();
}
private void Playback()
{
var sim = new InputSimulator();
sim.PlayBack(_macroEvents);
}
keyboardWatcher = eventHookFactory.GetKeyboardWatcher().Disable(MacroEventType.KeyDown | MacroEventType.KeyUp).Enable(MacroEventType.KeyPress);
mouseWatcher = eventHookFactory.GetMouseWatcher().Enable(MacroEventType.MouseDoubleClick | MacroEventType.MouseDragStarted).Disable(MacroEventType.MouseDragFinished | MacroEventType.MouseMove);
var sim = new InputSimulator().Enable(MacroEventType.MouseDoubleClick | MacroEventType.KeyPress).Disable(MacroEventType.MouseMove | MacroEventType.KeyDown | MacroEventType.KeyUp);
(also have a look at the Demo app included with the source)
The MIT license see: LICENSE
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net40 net40 is compatible. net403 net403 was computed. net45 net45 was computed. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
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.
|