HolzShots.Input.Keyboard 2.0.0-preview.3

This is a prerelease version of HolzShots.Input.Keyboard.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package HolzShots.Input.Keyboard --version 2.0.0-preview.3
NuGet\Install-Package HolzShots.Input.Keyboard -Version 2.0.0-preview.3
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="HolzShots.Input.Keyboard" Version="2.0.0-preview.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HolzShots.Input.Keyboard --version 2.0.0-preview.3
#r "nuget: HolzShots.Input.Keyboard, 2.0.0-preview.3"
#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.
// Install HolzShots.Input.Keyboard as a Cake Addin
#addin nuget:?package=HolzShots.Input.Keyboard&version=2.0.0-preview.3&prerelease

// Install HolzShots.Input.Keyboard as a Cake Tool
#tool nuget:?package=HolzShots.Input.Keyboard&version=2.0.0-preview.3&prerelease

HolzShots.Input.Keyboard

Global Hotkey library used in HolzShots.

Usage of Hotkey primitives:

var hook = KeyboardHookSelector.CreateHookForCurrentPlatform(someForm);
// someForm can be anything that implements ISynchronizeInvoke

var hk = new Hotkey(Input.Keyboard.ModifierKeys.Shift, Keys.F8);
hk.KeyPressed += (hook, h) => Console.WriteLine($"Hotkey pressed: {h}");

hook.RegisterHotkey(hk);

var hk2 = Hotkey.Parse("Shift+F9");
hk2.KeyPressed += (hook, h) => Console.WriteLine($"Hotkey pressed: {h}");

hook.RegisterHotkey(hk2);

// Clean up:
hook.UnregisterHotkey(hk2);

hook.UnregisterAllHotkeys();

The Hotkey class can be serialized to Windows Forms Settings as well as re-instantiated using Hotkey.Parse(hk.ToString()). You may also implement a JSON converter to parse hotkey strings from JSON config files.

Product Compatible and additional computed target framework versions.
.NET net7.0-windows7.0 is compatible.  net8.0-windows 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
2.0.0-preview.4 577 6/14/2023
2.0.0-preview.3 200 1/30/2023