NonInvasiveKeyboardHookLibrary 1.3.0

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

// Install NonInvasiveKeyboardHookLibrary as a Cake Tool
#tool nuget:?package=NonInvasiveKeyboardHookLibrary&version=1.3.0


A C# hotkey manager that uses a low level global hook, but allows registering for specific keys to reduce invasion of user privacy.

Get it on NuGet


var keyboardHookManager = new KeyboardHookManager();

// Register virtual key code 0x60 = NumPad0
keyboardHookManager.RegisterHotkey(0x60, () =>
    Debug.WriteLine("NumPad0 detected");

// Modifiers are supported too
keyboardHookManager.RegisterHotkey(NonInvasiveKeyboardHookLibrary.ModifierKeys.Control, 0x60, () => 
    Debug.WriteLine("Ctrl+NumPad0 detected");

// Multiple modifiers can be specified using the bitwise OR operation
keyboardHookManager.RegisterHotkey(NonInvasiveKeyboardHookLibrary.ModifierKeys.Control | NonInvasiveKeyboardHookLibrary.ModifierKeys.Alt, 0x60, () => 
    Debug.WriteLine("Ctrl+Alt+NumPad0 detected");

// Or as an enum of modifiers
keyboardHookManager.RegisterHotkey(new[]{NonInvasiveKeyboardHookLibrary.ModifierKeys.Control, NonInvasiveKeyboardHookLibrary.ModifierKeys.Alt}, 0x60, () =>
    Debug.WriteLine("Ctrl+Alt+NumPad0 detected");
Product Versions
.NET Framework net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on NonInvasiveKeyboardHookLibrary:

Repository Stars
Learn your custom layout quickly and easily by displaying your ErgoDox layout right from your desktop !
Version Downloads Last updated
2.2.0 444 10/22/2022
2.1.1 952 5/20/2021
2.1.0 1,452 11/8/2020
2.0.0 385 11/7/2020
1.5.0 666 10/26/2019
1.4.0 689 3/12/2019
1.3.0 1,100 12/29/2018
1.2.0 743 12/28/2018
1.1.0 733 12/26/2018
1.0.1 695 12/23/2018
1.0.0 749 12/21/2018

Internal implementation adjusted to handle keyboard input with a thread pool to avoid slowing down keyboard input.