예제 #1
0
        /// <summary>
        /// Executes the command.
        /// </summary>
        public override void Execute()
        {
            // Set the position of the mouse before execution.
            UserMouseEvent.SetCursorPos(this.MouseX, this.MouseY);

            // Execute the command using absolute coordinate.
            if (this.MouseEventFlag != MouseEventFlag.Move)
            {
                UserMouseEvent.RaiseMouseEvent(MouseEventFlag.Absolute | this.MouseEventFlag, this.MouseX, this.MouseY, this.WheelMovement);
            }
        }
예제 #2
0
        private void cmdKeyboardInput_Click(object sender, RoutedEventArgs e)
        {
            UserMouseEvent.SetCursorPos(1920, 1080);
            UserMouseEvent.MouseLeftClick(1920, 1080);

            // Send keys to current active window.
            SendKeys.SendWait("ABC");
            SendKeys.SendWait("{ENTER}");
            SendKeys.SendWait("BiuBiuBiu");
            SendKeys.SendWait("{ENTER}");
        }
예제 #3
0
        private void cmdMouseRightClick_Click(object sender, RoutedEventArgs e)
        {
            UserMouseEvent.SetCursorPos(1920, 1080);
            UserMouseEvent.MouseRightClick(1920, 1080);

            //MessageBox.Show("Ready for next?");

            UserMouseEvent.SetCursorPos(2560, 1440);
            UserMouseEvent.MouseRightClick(2560, 1440);

            // Show some thing when this window is not active.
            // This test shows that the server part can still work when dealing with client commands.
            txtMouseEvents.AppendText("Append some text when this window is not active.");
        }
예제 #4
0
 private void cmdSetCursor_Click(object sender, RoutedEventArgs e)
 {
     UserMouseEvent.SetCursorPos(1920, 1080);
 }