private static void MouseClick(NunchukState nunchukState) { if (!state.NunchukState.Z && nunchukState.Z) { MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown | MouseOperations.MouseEventFlags.LeftUp); } }
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); } }
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); } }
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); } }