Introduction
SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET. It is a wrapper of libuiohook and provides direct access to its features as well as higher-level types to work with it.
Installation
dotnet add package SharpHook --version 5.3.8
dotnet add package SharpHook.Reactive --version 5.3.8
Supported Platforms
SharpHook targets .NET 6+, .NET Framework 4.6.2+, and .NET Standard 2.0. The following table describes the availability of SharpHook on various platforms:
Windows | macOS | Linux | |
---|---|---|---|
x86 | Yes | N/A | No |
x64 | Yes | Yes | Yes |
Arm32 | No | N/A | Yes |
Arm64 | Yes | Yes | Yes |
Platform support notes:
Windows 10/11 is supported. Support for Windows on Arm32 was removed in version 5.0.0 since it was removed in .NET 5.
macOS 10.15+ is supported. Mac Catalyst is also supported (13.1+). macOS requires that the accessibility API be enabled for the application if it wants to create a global hook.
Linux distributions supported by .NET are supported by SharpHook. Linux on x86 is not supported by .NET itself. Only X11 is supported - Wayland support may be coming, but it's not yet here.
More info on OS support can be found in an article on OS-specific constraints.