Пример #1
0
        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();
            }
        }
Пример #2
0
 private static void MouseWheel(object sender, MouseEventArgs e)
 {
     if (Heading || Yoke)
     {
         XPlane.ChangeThrottle((short)e.Delta);
     }
 }
Пример #3
0
        private void btnDeactivate_Click(object sender, EventArgs e)
        {
            Input.StopAsync();
            XPlane.StopAsync();

            this.btnActive.Visible     = true;
            this.btnDeactivate.Visible = false;
        }
Пример #4
0
        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();
            }
        }