SharpHook.ReactiveUI 8.0.0

dotnet add package SharpHook.ReactiveUI --version 8.0.0
                    
NuGet\Install-Package SharpHook.ReactiveUI -Version 8.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpHook.ReactiveUI" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpHook.ReactiveUI" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpHook.ReactiveUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpHook.ReactiveUI --version 8.0.0
                    
#r "nuget: SharpHook.ReactiveUI, 8.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SharpHook.ReactiveUI@8.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpHook.ReactiveUI&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SharpHook.ReactiveUI&version=8.0.0
                    
Install as a Cake Tool

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.ReactiveUIGlobalHookAdapter 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 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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