Example #1
0
 private void OnMouseMove(object sender, MouseEventArgs e)
 {
     if (!isPositionLocked)
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
Example #2
0
 private void OnMouseMoveEvent(SDL.SDL_MouseMotionEvent e)
 {
     if (IsPositionLocked)
     {
         MouseState.HandleMouseDelta(new Vector2(e.xrel, e.yrel));
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.x, e.y));
     }
 }
Example #3
0
 private void OnMouseMoveEvent(MouseMotionEvent e)
 {
     if (IsPositionLocked)
     {
         MouseState.HandleMouseDelta(new Vector2(e.Xrel, e.Yrel));
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
Example #4
0
 private void OnMouseMove(object sender, MouseEventArgs e)
 {
     if (isPositionLocked)
     {
         // Register mouse delta and reset
         MouseState.HandleMouseDelta(new Vector2(Cursor.Position.X - capturedPosition.X, Cursor.Position.Y - capturedPosition.Y));
         targetPosition    = capturedPosition;
         shouldSetPosition = true;
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
Example #5
0
        private void OnMouseMoveEvent(SDL.SDL_MouseMotionEvent e)
        {
            if (IsPositionLocked)
            {
                MouseState.HandleMouseDelta(new Vector2(e.x - relativeCapturedPosition.X, e.y - relativeCapturedPosition.Y));

                // Restore position to prevent mouse from going out of the window where we would not get
                // mouse move event.
                uiControl.RelativeCursorPosition = relativeCapturedPosition;
            }
            else
            {
                MouseState.HandleMove(new Vector2(e.x, e.y));
            }
        }