Skip to content

KaneLeung/Kane.GlobalHook

Repository files navigation

dotnet-version nuget-version Nuget

如何使用

Step 1:添加引用或在Nuget直接搜索【Kane.GlobalHook】;

Install-Package Kane.GlobalHook

Step 2:使用方法:

Keyboard Hook 挂载键盘钩子

    var keyboardHook = new KeyboardHook();
    keyboardHook.KeyEvent += (sender,e) =>
    {
        //e为 KeyboardHookEventArgs 
        //事件
    };
    keyboardHook.Hook();//挂载键盘钩子

Keyboard Unhook 卸载键盘钩子

    keyboardHook.Unhook();//卸载键盘钩子

Mouse Hook 挂载鼠标钩子

    var mouseHook = new MouseHook();
    mouseHook.MouseEvent += (sender,e) =>
    {
        //e为 MouseHookEventArgs 
        //事件
    };
    mouseHook.Hook();//挂载鼠标钩子

Mouse Unhook 卸载钩子

    mouseHook.Unhook();//卸载鼠标钩子

About

Window全局钩子

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages