我是C#.Net的新手。我想使用在「https://github.com/rvknth043/Global-Low-Level-Key-Board-And-Mouse-Hook」上找到的「Global-Low-Level-Key-Board-And-Mouse-Hook」庫。它用於在低級別捕獲keyup和keydown事件。C# - 低級別鍵鉤和處理事件
根據相關文檔我可以捕獲鍵向下和向上使用回撥功能的事件作爲
KeyboardHook keyboardHook = new KeyboardHook();
keyboardHook.KeyDown += new KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
keyboardHook.KeyUp += new KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);
在裏面的keyboardHook_KeyDown
& & keyboardHook_KeyUp
,我知道哪個鍵有漲有跌。但是,我想在某些情況下處理此事件,例如,如果關鍵「R」和「C」down,則將事件處理爲true,否則傳遞給應用程序。
我通過班去,發現keyboardHook_KeyDown
& & keyboardHook_KeyUp
定義爲
public event KeyboardHookCallback KeyDown;
public event KeyboardHookCallback KeyUp;
你試過了什麼,你得到什麼錯誤等等等 –