Interceptor.Input.SendText C# (CSharp) Method

SendText() public method

Warning: Only use this overload for sending letters, numbers, and symbols (those to the right of the letters on a U.S. keyboard and those obtained by pressing shift-#). Do not send special keys like Tab or Control or Enter.
public SendText ( string text ) : void
text string
return void
        public void SendText(string text)
        {
            foreach (char letter in text)
            {
                var tuple = CharacterToKeysEnum(letter);

                if (tuple.Item2 == true) // We need to press shift to get the next character
                    SendKey(Keys.LeftShift, KeyState.Down);

                SendKey(tuple.Item1);

                if (tuple.Item2 == true)
                    SendKey(Keys.LeftShift, KeyState.Up);
            }
        }

Usage Example

Example #1
0
        private void SendKey(string txt)
        {
            input.SendText(txt);

            // enter
            if (chkReturn.Checked)
            {
                input.SendKeys(icp.Keys.Enter);
            }
        }
All Usage Examples Of Interceptor.Input::SendText