Nuget添加引用spa
Install-Package FMUtils.KeyboardHook
調用示例:rest
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... } }