コード例 #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
ファイル: FormMain.cs プロジェクト: digovc/XPControl
        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();
            }
        }