Exemple #1
0
        /// <summary>
        /// Steers the mouse towards the target
        /// </summary>
        public override void Start()
        {
            // get target
            Point t = this.Target;

            // get current mouse position
            Point c = this.PointToClient(Cursor.Position);

            if (this.Buttons != MouseButtons.None)
            {
                VirtualInput.BeginMouveMouse(this.Buttons);
            }

            while (c != t)
            {
                int dx = Math.Min(this.MaxVelocity.X, Math.Max(-this.MaxVelocity.X, t.X - c.X));
                int dy = Math.Min(this.MaxVelocity.Y, Math.Max(-this.MaxVelocity.Y, t.Y - c.Y));
                if (Math.Abs(dx) < 2 && Math.Abs(dy) < 2)
                {
                    return;
                }
                VirtualInput.MouveMouse(
                    dx,
                    dy
                    );

                c = this.PointToClient(Cursor.Position);
            }

            if (this.Buttons != MouseButtons.None)
            {
                VirtualInput.EndMouveMouse(this.Buttons);
            }
        }
Exemple #2
0
 public override void Start()
 {
     VirtualInput.PressKey(this.Form.Handle, Key);
 }
Exemple #3
0
 /// <summary>
 /// Executes the mouse click
 /// </summary>
 public override void Start()
 {
     VirtualInput.MouseClick(this.Buttons);
 }
Exemple #4
0
 public override void Start()
 {
     VirtualInput.KeyUp(this.Form.Handle, Key);
 }