SharpHook.R3
7.0.0
See the version list below for details.
dotnet add package SharpHook.R3 --version 7.0.0
NuGet\Install-Package SharpHook.R3 -Version 7.0.0
<PackageReference Include="SharpHook.R3" Version="7.0.0" />
<PackageVersion Include="SharpHook.R3" Version="7.0.0" />
<PackageReference Include="SharpHook.R3" />
paket add SharpHook.R3 --version 7.0.0
#r "nuget: SharpHook.R3, 7.0.0"
#:package SharpHook.R3@7.0.0
#addin nuget:?package=SharpHook.R3&version=7.0.0
#tool nuget:?package=SharpHook.R3&version=7.0.0
SharpHook.R3
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.
If you're using R3, you can use the SharpHook.R3 package to integrate SharpHook with R3.
Usage
Basic Usage
Refer to the SharpHook package for the basic usage guidelines.
R3 Global Hooks
SharpHook.R3 provides the IR3GlobalHook
interface along with a default implementation and an adapter which you can use
to use to control the global hook and subscribe to its observables. Here's a basic example:
using SharpHook.R3;
// ...
var hook = new R3GlobalHook();
hook.HookEnabled.Subscribe(OnHookEnabled);
hook.HookDisabled.Subscribe(OnHookDisabled);
hook.KeyTyped.Subscribe(OnKeyTyped);
hook.KeyPressed.Subscribe(OnKeyPressed);
hook.KeyReleased.Subscribe(OnKeyReleased);
hook.MouseClicked.Subscribe(OnMouseClicked);
hook.MousePressed.Subscribe(OnMousePressed);
hook.MouseReleased.Subscribe(OnMouseReleased);
hook.MouseMoved
.Debouce(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseMoved);
hook.MouseDragged
.Debouce(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseDragged);
hook.MouseWheel.Subscribe(OnMouseWheel);
hook.Run();
// or
await hook.RunAsync();
R3 global hooks are basically the same as the default global hooks and the same rules apply to them.
SharpHook.R3 provides two implementations of IR3GlobalHook
:
SharpHook.R3.R3GlobalHook
. Since we're dealing with observables, it's up to you to decide when and where to handle the events through time providers. A default time provider can be specified for all observables.SharpHook.R3.R3GlobalHookAdapter
adapts anIGlobalHook
toIR3GlobalHook
. All subscriptions and changes are propagated to the adapted hook. There is no default adapter fromIR3GlobalHook
toIGlobalHook
. A default time provider can be specified for all observables.
Logging
SharpHook.R3 contains IR3LogSource
and R3LogSourceAdapter
so you can use them in a more reactive way:
using SharpHook.Logging;
using SharpHook.R3.Logging;
// ...
var logSource = LogSource.RegisterOrGet();
var r3LogSource = new R3LogSourceAdapter(logSource);
r3LogSource.MessageLogged.Subscribe(this.OnMessageLogged);
Rx.NET Integration
As an alternative, SharpHook also provides integration with Rx.NET in the SharpHook.Reactive package.
Icon
Icon made by Freepik from www.flaticon.com.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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-maccatalyst18.0 is compatible. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 is compatible. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
-
.NETStandard 2.0
-
net8.0
-
net8.0-maccatalyst18.0
-
net9.0
-
net9.0-maccatalyst18.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.