public void Open() { if (working) { return; } hookId = SetHook(proc); HookStateChanged?.Invoke(true); working = true; }
// public void OpenForOneShortcut(Action<KeyShortcut> onKeysAction) // { // oneTimeKeys = onKeysAction; // Open(); // } public void Close() { if (!working) { return; } UnhookWindowsHookEx(hookId); HookStateChanged?.Invoke(false); working = false; //writer.Close(); }