Beispiel #1
0
        public void StartHookService(IConfigSource config      = null, HelpWindow helpWindow = null,
                                     ActionType actionHookType = ActionType.Both)
        {
            if (combinationsConfig == null)
            {
                LoadCombinationsConfiguration(config);
            }

            switch (actionHookType)
            {
            case ActionType.Keyboard:
                KeyboardHook = new KeyboardHook(logger, combinationsConfig, keysSounds, helpWindow);
                break;

            case ActionType.Mouse:
                MouseHook = new MouseHook(logger);
                break;

            default:
                KeyboardHook = new KeyboardHook(logger, combinationsConfig, keysSounds, helpWindow);
                MouseHook    = new MouseHook(logger);
                break;
            }
            KeyboardHook?.StartHook();
            MouseHook?.StartHook();
        }