private static void MouseClick(object sender, MouseEventArgs e) { if (Heading && e.Button == MouseButtons.XButton2) { XPlane.ResetHeading(); } if (e.Button == MouseButtons.XButton2) { Heading = !Heading; } if (e.Button == MouseButtons.XButton1) { Yoke = !Yoke; } if (Heading || Yoke) { StartMouseMonitor(); } else { StopMouseMonitor(); } }
private static void MouseWheel(object sender, MouseEventArgs e) { if (Heading || Yoke) { XPlane.ChangeThrottle((short)e.Delta); } }
private void btnDeactivate_Click(object sender, EventArgs e) { Input.StopAsync(); XPlane.StopAsync(); this.btnActive.Visible = true; this.btnDeactivate.Visible = false; }
private static void Calculate() { Console.WriteLine("Calculating"); var position = Cursor.Position; if (position.X != _lastPosition.X || position.Y != _lastPosition.Y) { PositionHeading = CalculateHeading(position.X, _halfWidth, SensibilityHeading); PositionRoll = CalculateHeading(position.X, _halfWidth, SensibilityRoll); PositionPitch = CalculateHeading(position.Y, _halfHeight, SensibilityPitch); _lastPosition = position; XPlane.SendInput(); } }