Пример #1
0
        private void Loop()
        {
            using Timer timer = new Timer {
                      Interval = 10
                  };

            timer.Tick += (sender, e) => {
                if (stopRequested)
                {
                    Logger.Debug("Stopping message loop");
                    Application.ExitThread();
                }
            };

            if (mouseHookManager.EnableHook() && keyboardHookManager.EnableHook())
            {
                inputSuccessful = true;
            }
            inputHookEvent.Set();

            timer.Start();

            Logger.Debug("Starting message loop");

            // Start the message loop
            Application.Run();
            Logger.Debug("Message loop stopped");
        }
Пример #2
0
        public bool EnableHook()
        {
            if (isHookEnabled)
            {
                return(false);
            }

            Logger.Debug("Enabling DebugHelper input hooks");

            isHookEnabled = mouseHookManager.EnableHook() && keyboardHookManager.EnableHook();
            return(isHookEnabled);
        }