Rework the HotkeyManager and KeyboardHook interop classes (#4710)

* Use GetAsyncKeyState calls and remove additional thread usage

* Removed Environment.Exit
This commit is contained in:
Arjun Balgovind
2020-07-03 08:21:06 -07:00
committed by GitHub
parent f9a5242e75
commit 8a908aa33f
5 changed files with 17 additions and 114 deletions

View File

@@ -26,7 +26,7 @@ public
public
delegate void HotkeyCallback();
typedef unsigned short HOTKEY_HANDLE;
typedef unsigned short HOTKEY_HANDLE;
public
ref class HotkeyManager
@@ -46,12 +46,9 @@ public
IsActiveCallback ^ isActiveCallback;
FilterKeyboardEvent ^ filterKeyboardCallback;
void KeyboardEventProc(KeyboardEvent ^ ev);
bool IsActiveProc();
bool FilterKeyboardProc(KeyboardEvent ^ ev);
HOTKEY_HANDLE GetHotkeyHandle(Hotkey ^ hotkey);
void UpdatePressedKeys(KeyboardEvent ^ ev);
void UpdatePressedKey(DWORD code, bool replaceWith, unsigned char replaceWithKey);
};
}