Exemple #1
0
 private static void MouseClick(NunchukState nunchukState)
 {
     if (!state.NunchukState.Z && nunchukState.Z)
     {
         MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown | MouseOperations.MouseEventFlags.LeftUp);
     }
 }
Exemple #2
0
        private static void MouseClick(ButtonState buttonState)
        {
            if (!state.ButtonState.A && buttonState.A)
            {
                MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown | MouseOperations.MouseEventFlags.LeftUp);
            }

            if (!state.ButtonState.B && buttonState.B)
            {
                MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.RightDown | MouseOperations.MouseEventFlags.RightUp);
            }
        }
Exemple #3
0
        private static void MoveMouse(NunchukState nunchukState)
        {
            var position  = MouseOperations.GetCursorPosition();
            var joyStickX = nunchukState.Joystick.X;
            var joyStickY = nunchukState.Joystick.Y;

            if (joyStickY > 0.05 || joyStickY < -0.05 || joyStickX > 0.05 || joyStickX < -0.05)
            {
                var posX = joyStickX > 0.1 ? position.X + _moveSpeed : position.X - _moveSpeed;
                var posY = joyStickY > 0.1 ? position.Y - _moveSpeed : position.Y + _moveSpeed;
                MouseOperations.SetCursorPosition(posX, posY);
            }
        }
Exemple #4
0
        private static void MoveMouse(ButtonState buttonState)
        {
            var position = MouseOperations.GetCursorPosition();

            if (buttonState.Left)
            {
                MouseOperations.SetCursorPosition(position.X - _moveSpeed, position.Y);
            }

            if (buttonState.Right)
            {
                MouseOperations.SetCursorPosition(position.X + _moveSpeed, position.Y);
            }

            if (buttonState.Up)
            {
                MouseOperations.SetCursorPosition(position.X, position.Y - _moveSpeed);
            }

            if (buttonState.Down)
            {
                MouseOperations.SetCursorPosition(position.X, position.Y + _moveSpeed);
            }
        }