SharpHook.ReactiveUI
8.0.0
dotnet add package SharpHook.ReactiveUI --version 8.0.0
NuGet\Install-Package SharpHook.ReactiveUI -Version 8.0.0
<PackageReference Include="SharpHook.ReactiveUI" Version="8.0.0" />
<PackageVersion Include="SharpHook.ReactiveUI" Version="8.0.0" />
<PackageReference Include="SharpHook.ReactiveUI" />
paket add SharpHook.ReactiveUI --version 8.0.0
#r "nuget: SharpHook.ReactiveUI, 8.0.0"
#:package SharpHook.ReactiveUI@8.0.0
#addin nuget:?package=SharpHook.ReactiveUI&version=8.0.0
#tool nuget:?package=SharpHook.ReactiveUI&version=8.0.0
SharpHook.ReactiveUI
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 ReactiveUI.Primitives, you can use the SharpHook.ReactiveUI package to integrate SharpHook with it.
Usage
Basic Usage
Refer to the SharpHook package for the basic usage guidelines.
Reactive Global Hooks
The base SharpHook package provides the IReactiveGlobalHook interface.
SharpHook.ReactiveUI provides an implementation of IReactiveGlobalHook which you can use to use to control the hook
and subscribe to its observables. Here's a basic example:
using SharpHook.ReactiveUI;
var hook = new ReactiveUIGlobalHook();
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.Subscribe(OnMouseMoved);
hook.MouseMovedRelative.Subscribe(OnMouseMovedRelative);
hook.MouseDragged.Subscribe(OnMouseDragged);
hook.MouseDraggedRelative.Subscribe(OnMouseDraggedRelative);
hook.MouseWheel.Subscribe(OnMouseWheel);
hook.Run();
// or
await hook.RunAsync();
Reactive global hooks are basically the same as the default global hooks and the same rules apply to them.
SharpHook.ReactiveUI provides two implementations of IReactiveGlobalHook:
SharpHook.ReactiveUI.ReactiveUIGlobalHook. Since we're dealing with observables, it's up to you to decide when and where to handle the events through sequencers. A default sequencer can be specified for all observables.SharpHook.ReactiveUI.ReactiveUIGlobalHookAdapteradapts anIGlobalHooktoIReactiveGlobalHook. All subscriptions and changes are propagated to the adapted hook. There is no default adapter fromIReactiveGlobalHooktoIGlobalHook. A default sequencer can be specified for all observables.
Logging
The base SharpHook package provides the IReactiveLogSource interface.
SharpHook.ReactiveUI contains ReactiveUILogSourceAdapter which adapts an ILogSource into an IReactiveLogSource:
using SharpHook.Logging;
using SharpHook.ReactiveUI.Logging;
var logSource = LogSource.RegisterOrGet();
var reactiveLogSource = new ReactiveUILogSourceAdapter(logSource);
reactiveLogSource.MessageLogged.Subscribe(this.OnMessageLogged);
Rx.NET Integration
As an alternative, SharpHook also provides integration with Rx.NET in the SharpHook.Reactive package.
R3 Integration
As an alternative, SharpHook also provides integration with R3 in the SharpHook.R3 package.
Icon
Icon made by Freepik from www.flaticon.com.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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 Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- ReactiveUI.Primitives (>= 7.2.0)
- SharpHook (>= 8.0.0)
-
net10.0
- ReactiveUI.Primitives (>= 7.2.0)
- SharpHook (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0 | 46 | 8/24/2026 |