Пример #1
0
        public void KeyDown(string keyToPress)
        {
            var key = KeyboardModifiers.GetVirtualKeyCode(keyToPress);

            this.modifiers.Add(keyToPress);
            CruciatusFactory.Keyboard.KeyDown(key);
        }
Пример #2
0
        public void KeyUp(string keyToRelease)
        {
            var key = KeyboardModifiers.GetVirtualKeyCode(keyToRelease);

            this.modifiers.Remove(keyToRelease);
            CruciatusFactory.Keyboard.KeyUp(key);
        }
Пример #3
0
        private void Type(char key)
        {
            string str = Convert.ToString(key);

            if (KeyboardModifiers.IsKeyMapped(str))
            {
                var keyCode = KeyboardModifiers.GetVirtualKeyCode(str);

                CruciatusFactory.Keyboard.KeyDown(keyCode);
                CruciatusFactory.Keyboard.KeyUp(keyCode);
            }
            else
            {
                if (this.modifiers.Contains(Keys.LeftShift) || this.modifiers.Contains(Keys.Shift))
                {
                    str = str.ToUpper();
                }


                CruciatusFactory.Keyboard.SendText(str);
            }
        }