About SharpHook
SharpHook. Version 4.2.1. Created by Tolik Pylypchuk.
Library Status
I will maintain the library to keep up with the releases of libuiohook which uses a rolling release model - every commit
to its 1.3
branch is considered stable. If you've noticed that this library hasn't gotten new commits in some time,
rest assured that it's not abandoned! I'm not giving up on this library any time soon.
Changelog
v4.2.1 (June 18, 2023)
libuiohook was updated to commit 34f279c.
Getting screen info for multiple screens was fixed on Windows.
A memory leak from getting screen info was fixed.
v4.2.0 (April 8, 2023)
libuiohook was updated to commit 56e8cb8.
The ability to simulate mouse movement relative to the current cursor position was added.
v4.1.0 (March 27, 2023)
libuiohook was updated to commit 3a90aeb.
The ability to simulate mouse press/release events at the current coordinates was added.
Turns out that libuiohook has always ignored mouse coordinates when simulating mouse wheel events, so the method which simulates them without coordinates was added, and the previous one was marked as obsolete.
v4.0.1 (March 12, 2023)
libuiohook was updated to commit 41a17e2 which fixes support for multiple screens on Windows.
v4.0.0 (November 9, 2022)
.NET 7 support was added and
[LibraryImport]
is used instead of[DllImport]
on it.Explicit targets for .NET 5 and .NET Core 3.1 were removed, though the library can be used on those platforms through .NET Standard.
HookEventArgs
now contains theSuppressEvent
property instead ofReserved
.KeyboardEventData.KeyChar
is now of typeushort
instead ofchar
- this was changed purely for marshalling reasons and it should still be used as achar
.Simulating mouse presses and releases now requires providing mouse pointer coordinates.
The ability to make
RunAsync
create a background thread was added.KeyCode.VcPrintscreen
was renamed toKeyCode.VcPrintScreen
.Versioned libuiohook binaries for macOS and Linux were removed from the NuGet package as they were bit-for-bit same as the unversioned binaries.
libuiohook is at commit 1ece4c4.
v3.1.3 (October 27, 2022)
- Copying native libraries to the build output folder should now work correctly for .NET Framework-based projects (#18).
v3.1.2 (October 19, 2022)
A fix for posting keyboard events on Windows was added, as suggested by FaithBeam, and fixes #20.
libuiohook is at commit fc779b0.
v3.1.1 (August 5, 2022)
v3.1.0 (July 30, 2022)
SharpHook now uses a build of libuiohook which links the C runtime statically on Windows. This means that Visual C++ Redistributable is not needed for client apps to run (the logging functionality is a exception though). (#14).
The
EmptyLogSource
class was added, mostly for using it instead ofLogSource
in release builds of client apps.A memory issue which was fixed for hooks in v3.0.1 was fixed for logging as well.
v3.0.2 (July 1, 2022)
Windows x86 support was fixed (#10).
The functions in
UioHook
which return system properties now returnint
instead oflong
. This is a tiny breaking change, but I believe it's too small to warrant a bump of the major (or even minor) version.
v3.0.1 (June 25, 2022)
A memory issue which arose only when debugging was fixed (#12).
libuiohook was updated to commit de3f683.
v3.0.0 (March 27, 2022)
The ability to get libuiohook logs was added.
Event simulation now ignores event masks not only on Windows, but everywhere, and returns a result.
UioHookEvent.Time
now contains the event's UNIX timestamp.IGlobalHook
andIReactiveGlobalHook
now contain theIsDisposed
property.The
HookEvent<TArgs>
class was removed from SharpHook.Reactive.Several minor (but breaking) changes in the
UioHook
class.libuiohook is now at version 1.3 and commit a887cde.
v2.0.0 (February 4, 2022)
Global hooks now support both blocking and non-blocking running via the
Run
andRunAsync
methods, and theStart
method was removed.Support for suppressing event propagation.
UioHookEvent.Time
now has the correct type -ulong
instead ofushort
.Global hooks now throw an exception if they are started when already running.
v1.1.0 (December 4, 2021)
Cross-platform input event simulation using libuiohook.
Support for Windows on Arm64.
MouseWheelEventData.Rotation
now has the correct type -short
instead ofushort
. This is a tiny breaking change, but had to be fixed.libuiohook was updated to commit 5cf864d.
v1.0.1 (November 21, 2021)
libuiohook was updated to commit 28ccf9c.
v1.0.0 (November 8, 2021)
This release is basically the same as v1.0.0 Preview 4, but built with a GA release of .NET 6.
v1.0.0 Preview 4 (November 6, 2021)
When
Dispose
on global hooks is called, they now reset the static hook callback function.HookDisabled
is now emitted correctly for reactive global hooks.The assemblies are now trimmable.
v1.0.0 Preview 3 (November 1, 2021)
IsRunning
was added toSharpHook.IGlobalHook
andSharpHook.Reactive.IReactiveGlobalHook
.Dispose
is now safe to call when the hook is not running for all implementations.libuiohook was updated to commit 4867b8e.
v1.0.0 Preview 2 (October 26, 2021)
SharpHook.Native.ModifierMask.None
was added.Package descriptions were fixed.
v1.0.0 Preview 1 (October 26, 2021)
The basic functionality is implemented: native functions, default global hooks, and reactive global hooks.
libuiohook is at commit e2c581f.