Exemplo n.º 1
0
        /// <summary>
        ///     Presses the right button of the mouse at the current cursor position.
        /// </summary>
        public void PressRight()
        {
            var input = CreateInput();

            input.Mouse.Flags = MouseFlags.RightDown;
            AWindowHelper.SendInput(input);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Presses the middle button of the mouse at the current cursor position.
        /// </summary>
        public void PressMiddle()
        {
            var input = CreateInput();

            input.Mouse.Flags = MouseFlags.MiddleDown;
            AWindowHelper.SendInput(input);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Releases the right button of the mouse at the current cursor position.
        /// </summary>
        public void ReleaseRight()
        {
            var input = CreateInput();

            input.Mouse.Flags = MouseFlags.RightUp;
            AWindowHelper.SendInput(input);
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Releases the middle button of the mouse at the current cursor position.
        /// </summary>
        public void ReleaseMiddle()
        {
            var input = CreateInput();

            input.Mouse.Flags = MouseFlags.MiddleUp;
            AWindowHelper.SendInput(input);
        }
Exemplo n.º 5
0
        /// <summary>
        ///     Scrolls vertically using the wheel of the mouse at the current cursor position.
        /// </summary>
        /// <param name="delta">The amount of wheel movement.</param>
        public void ScrollVertically(int delta = 120)
        {
            var input = CreateInput();

            input.Mouse.Flags     = MouseFlags.Wheel;
            input.Mouse.MouseData = delta;
            AWindowHelper.SendInput(input);
        }
Exemplo n.º 6
0
        /// <summary>
        ///     Moves the cursor at the specified coordinate.
        /// </summary>
        /// <param name="x">The x-coordinate.</param>
        /// <param name="y">The y-coordinate.</param>
        protected void MoveToAbsolute(int x, int y)
        {
            var input = CreateInput();

            input.Mouse.DeltaX    = CalculateAbsoluteCoordinateX(x);
            input.Mouse.DeltaY    = CalculateAbsoluteCoordinateY(y);
            input.Mouse.Flags     = MouseFlags.Move | MouseFlags.Absolute;
            input.Mouse.MouseData = 0;
            AWindowHelper.SendInput(input);
        }