![]() |
VOOZH | about |
dotnet add package SharpHook.R3 --version 7.1.2
NuGet\Install-Package SharpHook.R3 -Version 7.1.2
<PackageReference Include="SharpHook.R3" Version="7.1.2" />
<PackageVersion Include="SharpHook.R3" Version="7.1.2" />Directory.Packages.props
<PackageReference Include="SharpHook.R3" />Project file
paket add SharpHook.R3 --version 7.1.2
#r "nuget: SharpHook.R3, 7.1.2"
#:package SharpHook.R3@7.1.2
#addin nuget:?package=SharpHook.R3&version=7.1.2Install as a Cake Addin
#tool nuget:?package=SharpHook.R3&version=7.1.2Install as a Cake Tool
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.
Refer to the SharpHook package for the basic usage guidelines.
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 an IGlobalHook to IR3GlobalHook. All subscriptions and changes are
propagated to the adapted hook. There is no default adapter from IR3GlobalHook to IGlobalHook. A default time
provider can be specified for all observables.
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);
As an alternative, SharpHook also provides integration with Rx.NET in the SharpHook.Reactive package.
Icon made by Freepik from www.flaticon.com.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 net10.0-maccatalyst26.0 is compatible. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.