Esempio n. 1
0
 public void Open()
 {
     if (working)
     {
         return;
     }
     hookId = SetHook(proc);
     HookStateChanged?.Invoke(true);
     working = true;
 }
Esempio n. 2
0
//        public void OpenForOneShortcut(Action<KeyShortcut> onKeysAction)
//        {
//            oneTimeKeys = onKeysAction;
//            Open();
//        }

        public void Close()
        {
            if (!working)
            {
                return;
            }
            UnhookWindowsHookEx(hookId);
            HookStateChanged?.Invoke(false);
            working = false;
            //writer.Close();
        }