예제 #1
0
 private void OnMouseMove(object sender, MouseEventArgs e)
 {
     if (!isPositionLocked)
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
예제 #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));
     }
 }
예제 #3
0
파일: MouseSDL.cs 프로젝트: Alan-love/xenko
 private void OnMouseMoveEvent(MouseMotionEvent e)
 {
     if (IsPositionLocked)
     {
         MouseState.HandleMouseDelta(new Vector2(e.Xrel, e.Yrel));
     }
     else
     {
         MouseState.HandleMove(new Vector2(e.X, e.Y));
     }
 }
예제 #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));
     }
 }
예제 #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));
            }
        }