Ejemplo n.º 1
0
        bool ParseNonPrintable(
            ParsePosition position,
            List <IInputAction> pressInputs,
            List <IInputAction> releaseInputs)
        {
            var separator = new char[1] {
                '}'
            };
            var strArray1 = position.ToString().Split(separator: (char[])null, options: StringSplitOptions.RemoveEmptyEntries);

            if (strArray1.Length != 0)
            {
                var strArray2 = strArray1[0].Split(separator: separator, options: StringSplitOptions.RemoveEmptyEntries);
                if (strArray2.Length != 0)
                {
                    var str = strArray2[0];
                    if (this.keyTranslator.IsNonPrintableName(name: str))
                    {
                        pressInputs.AddRange(collection: Input.CreateKeyInput(key: this.keyTranslator.GetVirtualKey(keyName: str), action: KeyAction.Press, duration: SendKeysDelay));
                        releaseInputs.AddRange(collection: Input.CreateKeyInput(key: this.keyTranslator.GetVirtualKey(keyName: str), action: KeyAction.Release, duration: SendKeysDelay));
                        position.Skip(count: str.Length);
                        return(true);
                    }
                }
            }

            return(false);
        }