Пример #1
0
 public static void SendInput(CharacterInput input)
 {
     if (input.HasModifier)
     {
         SendKeyDown(input.Modifier.Value);
         SendKeyPress(input.MainKey);
         SendKeyUp(input.Modifier.Value);
     }
     else
     {
         SendKeyPress(input.MainKey);
     }
 }
Пример #2
0
        public static void SendCharsSpooky(int msDelay, params char[] text)
        {
            CharacterInput[] codes = new CharacterInput[text.Length];
            for (int i = 0; i < text.Length; i++)
            {
                CharacterInput n = _getInputSet(text[i]);
                if (n != null)                  // Only typable characters are sent.
                {                               // Others are ignored.
                    codes[i] = n;
                }
            }

            foreach (CharacterInput ci in codes)
            {
                Thread.Sleep(msDelay);
                SendInput(ci);
            }
        }