コード例 #1
0
ファイル: GameHost.cs プロジェクト: Hengle/Engine-Nine
        void Surface_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (inputComponent != null)
            {
                Surface.CaptureMouse();

                if (e.ChangedButton == MouseButton.Left)
                {
                    leftDown = true;
                }
                else if (e.ChangedButton == MouseButton.Right)
                {
                    rightDown = true;
                }
                else if (e.ChangedButton == MouseButton.Middle)
                {
                    middleDown = true;
                }

                MouseEventArgs args;
                var            cursor = Microsoft.Xna.Framework.Input.Mouse.GetState();
                inputComponent.MouseDown(args = new MouseEventArgs(ConvertButton(e.ChangedButton), (int)cursor.X, (int)cursor.Y, 0));
                e.Handled = args.Handled;
            }
        }