public void KeyDown(string keyToPress) { var key = KeyboardModifiers.GetVirtualKeyCode(keyToPress); this.modifiers.Add(keyToPress); CruciatusFactory.Keyboard.KeyDown(key); }
public void KeyUp(string keyToRelease) { var key = KeyboardModifiers.GetVirtualKeyCode(keyToRelease); this.modifiers.Remove(keyToRelease); CruciatusFactory.Keyboard.KeyUp(key); }
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); } }
public bool IsModifier() { return(KeyboardModifiers.IsModifier(this.unicodeKey)); }
public KeyEvent(char ch) { this.character = ch; this.unicodeKey = KeyboardModifiers.GetKeyFromUnicode(this.character); }