public void PressSpecialKey(KeyboardInput.SpecialKeys kSpecialKey)
 {
     Thread.Sleep(CommonData.iMinWait);
     wVStoreMainWindow.Keyboard.PressSpecialKey(kSpecialKey);
     Thread.Sleep(CommonData.iMinWait);
     wVStoreMainWindow.WaitWhileBusy();
 }
示例#2
0
 protected virtual void AddUsedKey(KeyboardInput.SpecialKeys key)
 {
     if (heldKeys.Contains(key))
     {
         return;
     }
     heldKeys.Add(key);
 }
示例#3
0
 protected virtual void RemoveUsedKey(KeyboardInput.SpecialKeys key)
 {
     if (!heldKeys.Contains(key))
     {
         return;
     }
     heldKeys.Remove(key);
 }
示例#4
0
        public void WhenIPressTheKeyInRowOfThatGrid(KeyboardInput.SpecialKeys key,
                                                    int rowNumber)
        {
            var row = GetRowFromIndex(rowNumber);

            row.Select();
            row.KeyIn(key);
        }
示例#5
0
 public static void HotKey(KeyboardInput.SpecialKeys key1, KeyboardInput.SpecialKeys key2)
 {
     Console.WriteLine("Press Hotkey:" + key1.ToString() + "+" + key2.ToString());
     Keyboard.Instance.HoldKey(key1);
     Thread.Sleep(1000);
     Keyboard.Instance.PressSpecialKey(key2);
     Thread.Sleep(1000);
     Keyboard.Instance.LeaveAllKeys();
     Thread.Sleep(1000);
 }
示例#6
0
        public void ArrowsTest(
            IList <string> textToInsert,
            string marker,
            int strToClick, int chrToClick,
            string expectedText,
            KeyboardInput.SpecialKeys arrow)
        {
            var textEditBox = MainWindow.TextEditBoxForm;

            EnterAndClick(textEditBox, textToInsert, strToClick, chrToClick);
            textEditBox.PressKey(arrow);
            textEditBox.EnterOneLineText(marker);
            Assert.AreEqual(expectedText, textEditBox.Text);
        }
        public void ArrowsAfterSelectTest(
            KeyboardInput.SpecialKeys arrow)
        {
            var textToInsert = BaseTestObjects.TextToInsertSelectedTests;

            var(startStr, startChr, endStr, endChr) = BaseTestObjects.BoundsSelectedTests.FirstOrDefault();
            var textEditBox = MainWindow.TextEditBoxForm;

            EnterAndSelect(textEditBox, textToInsert, startStr, startChr, endStr, endChr);
            textEditBox.Click();

            textEditBox.RightClick();
            var contextMenu = MainWindow.ContextMenuForm;

            contextMenu.Copy();
            Assert.IsEmpty(ClipboardHelper.GetText(string.Empty));
        }
示例#8
0
 /// <summary>
 /// Implements <see cref="IKeyboardWithActionListener.LeaveKey(KeyboardInput.SpecialKeys, IActionListener)"/>
 /// </summary>
 public virtual void LeaveKey(KeyboardInput.SpecialKeys key, IActionListener actionListener)
 {
     SendKeyUp((short)key, true);
     RemoveUsedKey(key);
     actionListener.ActionPerformed(Action.WindowMessage);
 }
示例#9
0
 protected virtual void Send(KeyboardInput.SpecialKeys key, bool specialKey)
 {
     Press((short)key, specialKey);
 }
示例#10
0
文件: UIItem.cs 项目: timotei/White
 /// <summary>
 /// Implements <see cref="IUIItem.KeyIn"/>
 /// </summary>
 public virtual void KeyIn(KeyboardInput.SpecialKeys key)
 {
     actionListener.ActionPerforming(this);
     keyboard.PressSpecialKey(key, actionListener);
 }
示例#11
0
 /// <summary>
 /// Implements <see cref="IKeyboardWithActionListener.HoldKey(KeyboardInput.SpecialKeys, IActionListener)"/>
 /// </summary>
 public virtual void HoldKey(KeyboardInput.SpecialKeys key, IActionListener actionListener)
 {
     SendKeyDown((short)key, true);
     AddUsedKey(key);
     actionListener.ActionPerformed(Action.WindowMessage);
 }
示例#12
0
 public void PressKey(KeyboardInput.SpecialKeys @return)
 {
     ParentScreen.WhiteWindow.Keyboard.PressSpecialKey(@return);
 }
示例#13
0
 public virtual void LeaveKey(KeyboardInput.SpecialKeys key)
 {
     container.Focus();
     keyboard.LeaveKey(key, container);
 }
示例#14
0
 /// <summary>
 /// Implements <see cref="IKeyboard.PressSpecialKey(KeyboardInput.SpecialKeys)"/>
 /// </summary>
 public virtual void PressSpecialKey(KeyboardInput.SpecialKeys key)
 {
     PressSpecialKey(key, new NullActionListener());
 }
示例#15
0
 internal virtual void HoldKey(KeyboardInput.SpecialKeys key)
 {
     SendKeyDown((short)key, true);
     heldKeys.Add(key);
 }
示例#16
0
 public static void PressSpecialKey(this AttachedKeyboard keyboard, KeyboardInput.SpecialKeys holdKey, KeyboardInput.SpecialKeys specialKey)
 {
     keyboard.HoldKey(holdKey);
     keyboard.PressSpecialKey(specialKey);
     keyboard.LeaveKey(holdKey);
 }
示例#17
0
        public IIntoAction Key(KeyboardInput.SpecialKeys key)
        {
            var action = new Action <IUIItem>(i => i.KeyIn(key));

            return(_fixture.Data.Locate <IIntoAction>(constraints: new { _Values = new object[] { _fixture, action } }));
        }
示例#18
0
文件: Keyboard.cs 项目: Liarra/White
 private void Send(KeyboardInput.SpecialKeys key, bool specialKey)
 {
     Press((short)key, specialKey);
 }
示例#19
0
 internal virtual void HoldKey(KeyboardInput.SpecialKeys key, ActionListener actionListener)
 {
     SendKeyDown((short)key, true);
     heldKeys.Add(key);
     actionListener.ActionPerformed(Action.WindowMessage);
 }
示例#20
0
        public IIntoAction Key(KeyboardInput.SpecialKeys key)
        {
            Initialize();

            return(_data.Locate <IKeyInAction>(constraints: GetConstrainObject()).Key(key));
        }
示例#21
0
 public keyinfo(KeyboardInput.SpecialKeys specialKey)
 {
     isSpecialKey    = true;
     this.specialKey = specialKey;
 }
示例#22
0
 public virtual void LeaveKey(KeyboardInput.SpecialKeys key)
 {
     SendKeyUp((short)key, true);
     heldKeys.Remove(key);
 }
示例#23
0
 public void PressKey(KeyboardInput.SpecialKeys specialKeys)
 {
     TestLogger.Instance.Info($"Key '{specialKeys}' in '{_name}'");
     _source.KeyIn(specialKeys);
 }
示例#24
0
 public void KeyIn(KeyboardInput.SpecialKeys key)
 {
     LoggerUtil.Info($"Sending key to — {ItemName}. Key for enter — {key}");
     UiItem.KeyIn(key);
 }
示例#25
0
 /// <summary>
 /// Implements <see cref="IKeyboardWithActionListener.PressSpecialKey(KeyboardInput.SpecialKeys, IActionListener)"/>
 /// </summary>
 public virtual void PressSpecialKey(KeyboardInput.SpecialKeys key, IActionListener actionListener)
 {
     Send(key, true);
     actionListener.ActionPerformed(Action.WindowMessage);
 }
示例#26
0
 public virtual void PressSpecialKey(KeyboardInput.SpecialKeys key)
 {
     Send(key, true);
 }