Example #1
0
        public bool KeyProcessor(Keystroke.API.CallbackObjects.KeyPressed character)
        {
            string chrString = character.ToString();
            string backspace = "<backspace>";

            if (!chrString.Equals("<shift>") && !chrString.Equals(backspace))
            {
                keyBuffer += character;
                //Console.Write(character);
            }

            if (keyBuffer.Length > 25)
            {
                keyBuffer = keyBuffer.Remove(0, 1);
            }

            bool passOn = true;

            passOn = CheckForHotString();
            return(passOn);
        }
Example #2
0
 private void InitKeylogger()
 {
     keylogger.CreateKeyboardHook((character) =>
     {
         if (isSettingControl)
         {
             if (character.KeyCode == KeyCode.Escape)
             {
                 // Cancel trying to set the new control and reset it
                 controlKey         = null;
                 ControlButton.Text = "Click to Set";
                 isSettingControl   = false;
                 return;
             }
             controlKey         = character;
             ControlButton.Text = (controlKey.ToString() == " " ? "<space>" : controlKey.ToString());
             isSettingControl   = false;
         }
         else if (controlKey != null && character.ToString() == controlKey.ToString())
         {
             toggleActive();
         }
     });
 }