Beispiel #1
0
        private static void ExecutionThread()
        {
            KeyboardController.OnWordTyped += AnalyseCall;

            if (KeyboardController.HookKeyboard())
            {
                BadBoyLogger.LogInfo("Started BadBoy service");
            }
            else
            {
                BadBoyLogger.LogError("BadBoy service failed to start");

                return;
            }

            Application.Run();

            if (KeyboardController.ReleaseKeyboard())
            {
                BadBoyLogger.LogInfo("Stopped BadBoy service");
            }
            else
            {
                BadBoyLogger.LogError("BadBoy service failed to stop");
            }
        }
Beispiel #2
0
        private static void AnalyseCall(string word)
        {
            if (Filter.Analyse(word, out string analysedWord))
            {
                BadBoyLogger.LogInfo($"{word} -> {analysedWord}");

                SendKeys.Send("^{BACKSPACE}");
                SendKeys.Send(analysedWord);
            }
            else
            {
                BadBoyLogger.LogInfo($"{word} is clear");
            }
        }