![]() |
VOOZH | about |
dotnet add package SharpHook.Reactive --version 7.1.2
NuGet\Install-Package SharpHook.Reactive -Version 7.1.2
<PackageReference Include="SharpHook.Reactive" Version="7.1.2" />
<PackageVersion Include="SharpHook.Reactive" Version="7.1.2" />Directory.Packages.props
<PackageReference Include="SharpHook.Reactive" />Project file
paket add SharpHook.Reactive --version 7.1.2
#r "nuget: SharpHook.Reactive, 7.1.2"
#:package SharpHook.Reactive@7.1.2
#addin nuget:?package=SharpHook.Reactive&version=7.1.2Install as a Cake Addin
#tool nuget:?package=SharpHook.Reactive&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 Rx.NET, you can use the SharpHook.Reactive package to integrate SharpHook with Rx.NET.
Refer to the SharpHook package for the basic usage guidelines.
SharpHook.Reactive provides the IReactiveGlobalHook 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.Reactive;
// ...
var hook = new ReactiveGlobalHook();
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
.Throttle(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseMoved);
hook.MouseDragged
.Throttle(TimeSpan.FromSeconds(0.5))
.Subscribe(OnMouseDragged);
hook.MouseWheel.Subscribe(OnMouseWheel);
hook.Run();
// or
hook.RunAsync().Subscribe();
Reactive global hooks are basically the same as the default global hooks and the same rules apply to them.
SharpHook.Reactive provides two implementations of IReactiveGlobalHook:
SharpHook.Reactive.ReactiveGlobalHook. Since we're dealing with observables, it's up to you to decide when and where
to handle the events through schedulers. A default scheduler can be specified for all observables.
SharpHook.Reactive.ReactiveGlobalHookAdapter adapts an IGlobalHook to IReactiveGlobalHook. All
subscriptions and changes are propagated to the adapted hook. There is no default adapter from IReactiveGlobalHook
to IGlobalHook. A default scheduler can be specified for all observables.
SharpHook.Reactive contains IReactiveLogSource and ReactiveLogSourceAdapter so you can use them in a more reactive
way:
using SharpHook.Logging;
using SharpHook.Reactive.Logging;
// ...
var logSource = LogSource.RegisterOrGet();
var reactiveLogSource = new ReactiveLogSourceAdapter(logSource);
reactiveLogSource.MessageLogged.Subscribe(this.OnMessageLogged);
As an alternative, SharpHook also provides integration with R3 in the SharpHook.R3 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. |
Showing the top 3 NuGet packages that depend on SharpHook.Reactive:
| Package | Downloads |
|---|---|
|
Strem.Core
Package Description |
|
|
Strem.Flows.Default
Package Description |
|
|
M56X.Launcher.Hook
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.2 | 388 | 5/25/2026 |
| 7.1.1 | 2,773 | 12/30/2025 |
| 7.1.0 | 5,405 | 11/16/2025 |
| 7.0.3 | 1,854 | 10/5/2025 |
| 7.0.2 | 461 | 9/21/2025 |
| 7.0.1 | 3,797 | 8/17/2025 |
| 7.0.0 | 375 | 8/10/2025 |
| 6.2.0 | 851 | 7/19/2025 |
| 6.1.2 | 1,165 | 6/22/2025 |
| 6.1.1 | 1,137 | 6/3/2025 |
| 6.1.0 | 508 | 5/23/2025 |
| 6.0.0 | 337 | 5/18/2025 |
| 5.3.9 | 3,334 | 3/29/2025 |
| 5.3.8 | 5,919 | 9/27/2024 |
| 5.3.7 | 3,128 | 7/9/2024 |
| 5.3.6 | 803 | 5/22/2024 |
| 5.3.5 | 347 | 5/20/2024 |
| 5.3.4 | 525 | 5/5/2024 |
| 5.3.3 | 354 | 4/28/2024 |
| 5.3.2 | 1,999 | 4/2/2024 |