/// <summary> /// Simulate the left button being pressed /// </summary> public static void LeftButtonDown() { Input input = InputSender.AddMouseButtonDown(MouseButton.LeftButton); Input[] inputList = new Input[] { input }; InputSender.SendSimulatedInput(inputList); }
/// <summary> /// Simulate the right button being unpressed /// </summary> public static void RightButtonUp() { Input input = InputSender.AddMouseButtonUp(MouseButton.RightButton); Input[] inputList = new Input[] { input }; InputSender.SendSimulatedInput(inputList); }
/// <summary> /// Simulate an horizontal movement on a mouse wheel /// </summary> /// <param name="scrollAmountInClicks">the amount of scrolling in clicks</param> public static void HorizontalMouseWheel(int scrollAmountInClicks) { Input input = InputSender.AddMouseHorizontalWheel(scrollAmountInClicks * DELTA_WHEEL); Input[] inputList = new Input[] { input }; InputSender.SendSimulatedInput(inputList); }
/// <summary> /// Simulate a key being unpressed /// </summary> /// <param name="key">the key being unpressed</param> public static void KeyUp(WordsVirtualKey key) { if (keyDownList.Count != 0 && keyDownList.Contains(key)) { keyDownList.Remove(key); Input input = InputSender.AddKeyUp(key); Input[] inputList = new Input[] { input }; InputSender.SendSimulatedInput(inputList); } }
/// <summary> /// Simulate a key being pressed /// </summary> /// <param name="key">the key being pressed</param> public static void KeyDown(WordsVirtualKey key) { if (keyDownList == null) { keyDownList = new List <WordsVirtualKey>(); } //if the key is not already pressed if (!keyDownList.Contains(key)) { keyDownList.Add(key); Input input = InputSender.AddKeyDown(key); Input[] inputList = new Input[] { input }; InputSender.SendSimulatedInput(inputList); } }
/// <summary> /// Simulate the right button being clicked /// </summary> public static void RightButtonClick() { Input[] inputList = InputSender.AddMouseButtonClick(MouseButton.RightButton); InputSender.SendSimulatedInput(inputList); }
/// <summary> /// Simulate a key being pressed, a wheel movement, an then the key being unpressed /// </summary> /// <param name="key">the key being pressed</param> /// <param name="scrollAmountInClicks">the amount of scrolling in clicks</param> public static void KeyPlusWheel(WordsVirtualKey key, int scrollAmountInClicks) { Input[] inputList = InputSender.AddKeyPlusWheel(key, scrollAmountInClicks * DELTA_WHEEL); InputSender.SendSimulatedInput(inputList); }
/// <summary> /// Simulate a key being hited /// </summary> /// <param name="key">the key being hited</param> public static void KeyHit(WordsVirtualKey key) { Input[] inputList = InputSender.AddKeyPressed(key); InputSender.SendSimulatedInput(inputList); }