Exemplo n.º 1
0
        /// <inheritdoc cref="IKeyboard.DownAsync(string, DownOptions)"/>
        public Task DownAsync(string key, DownOptions options = null)
        {
            var  description = GetKeyDescriptionForString(key);
            bool autoRepeat  = _pressedKeys.Contains(description.Code);

            _pressedKeys.Add(description.Code);
            if (Enum.TryParse <Modifier>(key, out var modifier))
            {
                _pressedModifiers.Add(modifier);
            }

            string text = options?.Text ?? description.Text;

            return(_raw.KeyDownAsync(_pressedModifiers.ToArray(), description.Code, description.KeyCode, description.KeyCodeWithoutLocation, description.Key, Convert.ToInt32(description.Location), autoRepeat, text));
        }
Exemplo n.º 2
0
        private void ParseYou(string text)
        {
            string id;

            if (CommonExtensions.IsLinkYoutube(text, out id))
            {
                IsYouTube      = true;
                youId          = id;
                SelectedOption = DownOptions.Select(x => x.Value).First();
            }
            else
            {
                IsYouTube = false;
            }
        }
Exemplo n.º 3
0
 public void Run(DownOptions options)
 {
 }
Exemplo n.º 4
0
 /// <inheritdoc cref="IKeyboard.DownAsync(string, DownOptions)"/>
 public Task DownAsync(string key, DownOptions options = null)
 {
     throw new NotImplementedException();
 }