예제 #1
0
        void Surface_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            if (inputComponent != null)
            {
                // This produces more smooth result then the MouseMove event triggered by wpf.
                var cursor = Microsoft.Xna.Framework.Input.Mouse.GetState();

                MouseEventArgs args = new MouseEventArgs(MouseButtons.Left, (int)cursor.X, (int)cursor.Y, 0);
                args.IsLeftButtonDown   = leftDown;
                args.IsRightButtonDown  = rightDown;
                args.IsMiddleButtonDown = middleDown;
                inputComponent.MouseMove(args);
                mouseX = cursor.X;
                mouseY = cursor.Y;
            }
        }