FMUtils.KeyboardHook 轻量级键盘监听器
Nuget添加引用
Install-Package FMUtils.KeyboardHook
调用示例:
var KeyboardHook = new Hook("Global Action Hook"); KeyboardHook.KeyDownEvent += KeyDown; // Also: KeyboardHook.KeyUpEvent += KeyUp; private void KeyDown(KeyboardHookEventArgs e) { // handle keydown event here // Such as by checking if e (KeyboardHookEventArgs) matches the key you're interested in if (e.Key == Keys.F12 && e.isCtrlPressed) { // Do your magic... } }