예제 #1
0
 void _inputService_MouseMove(object sender, MouseStateEventArgs e)
 {
     if (_inputService.IsMouseDown(MouseButton.Left))
     {
         _camera.Position += e.PositionDelta;
     }
 }
 internal void OnMouseStateChanged(object sender, MouseStateEventArgs e)
 {
     if (!e.Cancel)
     {
         mouseState = e.NewState;
         // TODO
         System.Diagnostics.Debug.WriteLine("MineView.MouseState = " + mouseState);
     }
 }
        private void UpdateMouseState(MouseState newMouseState)
        {
            if (currentState != newMouseState)
            {
                BindModifiers modifiersNow = GetCurrentBindModifiers();
                foreach (BindModifiers mod in stubbornStates.GetOrEmpty(currentState))
                {
                    if (modifiersNow.Applies(mod))
                    {
                        return;
                    }
                }

                MouseStateEventArgs e = new MouseStateEventArgs(newMouseState, currentState, modifiersNow);
                this.MouseStateChanged?.Invoke(this, e);
                if (!e.Cancel)
                {
                    currentState = newMouseState;
                }
            }
        }
예제 #4
0
 /// <summary>Invokes the mouse state changed event.</summary>
 /// <param name="e">The event args.</param>
 protected virtual void OnMouseStateChanged(MouseStateEventArgs e)
 {
     Invalidate();
     MouseStateChanged?.Invoke(e);
 }
예제 #5
0
 /// <summary>Invokes the mouse state changed event.</summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The event args.</param>
 protected virtual void OnMouseStateChanged(object sender, MouseStateEventArgs e)
 {
     Invalidate();
     MouseStateChanged?.Invoke(sender, e);
 }
예제 #6
0
 private void OnMouseMove(object sender, MouseStateEventArgs e)
 {
 }
예제 #7
0
 private void OnMouseLeftDown(object sender, MouseStateEventArgs e)
 {
 }