// touch handling
 private void OnMouseButtonDown(object sender, NativeWindowMouseEventArgs e)
 {
     if (e.Buttons == MouseButton.Left)
     {
         _touchProcessor.OnPointerDown(e.Location.X, e.Location.Y, 1);
     }
 }
 private void NativeWindow_MouseDown(object sender, NativeWindowMouseEventArgs e)
 {
     if (e.Buttons == MouseButton.Left)
     {
         userAction.hit = true;
         Vector2 screenPos = new Vector2((float)e.Location.X / (float)zedCamera.ImageWidth, ((float)zedCamera.ImageHeight - (float)e.Location.Y) / (float)zedCamera.ImageHeight);
         userAction.hitCoord = screenPos;
     }
 }
 private void OnMouseMove(object sender, NativeWindowMouseEventArgs e)
 {
     if (e.Buttons == MouseButton.Right)
     {
         _touchProcessor.OnPointerMove(e.Location.X, e.Location.Y, 1);
     }
     else
     {
         _touchProcessor.OnMouseHover(e.Location.X, e.Location.Y, 1);
     }
 }
 public void mouseEventFunction(NativeWindowMouseEventArgs e)
 {
     // Rotate camera with mouse
     if (e.Buttons == OpenGL.CoreUI.MouseButton.Left)
     {
         camera_.rotate(Quaternion.CreateFromAxisAngle(camera_.getRight(), (float)mouseMotion_[1] * MOUSE_R_SENSITIVITY));
         camera_.rotate(Quaternion.CreateFromAxisAngle(camera_.getVertical() * -1f, (float)mouseMotion_[0] * MOUSE_R_SENSITIVITY));
     }
     if (e.Buttons == OpenGL.CoreUI.MouseButton.Right)
     {
         camera_.translate(camera_.getUp() * (float)mouseMotion_[1] * MOUSE_T_SENSITIVITY);
         camera_.translate(camera_.getRight() *  -(float)mouseMotion_[0] * MOUSE_T_SENSITIVITY);
     }
 }
Exemple #5
0
 private void MouseDown(object sender, NativeWindowMouseEventArgs e)
 {
     if ((e.Buttons & MouseButton.Left) != 0)
     {
         Subject.Notify(NotifyType.MouseButtonDown, new MouseButtonNotifyArgs(0, this));
     }
     if ((e.Buttons & MouseButton.Right) != 0)
     {
         Subject.Notify(NotifyType.MouseButtonDown, new MouseButtonNotifyArgs(1, this));
     }
     if ((e.Buttons & MouseButton.Middle) != 0)
     {
         Subject.Notify(NotifyType.MouseButtonDown, new MouseButtonNotifyArgs(2, this));
     }
 }
Exemple #6
0
        private void MouseMove(object sender, NativeWindowMouseEventArgs e)
        {
            var mousePos = new Vector2(e.Location.X, e.Location.Y);

            var mouseDelta = lastMousePos - mousePos;

            if (ignoreSingleMouseDelta)
            {
                mouseDelta             = new Vector2(0, 0);
                ignoreSingleMouseDelta = false;
            }

            Subject.Notify(NotifyType.MouseMove, new MouseMoveNotifyArgs(mouseDelta, mousePos, this));

            lastMousePos = mousePos;

            //if (MouseMode == MouseMode.Locked)
            //    nativeWindow.SetCursorPos(new Point((int)(GameSettings.GamePosX + (GameSettings.GameResolutionX / 2)),
            //        (int)(GameSettings.GamePosY + (GameSettings.GameResolutionY / 2))));
        }
Exemple #7
0
 private void NativeWindow_MouseEvent(object sender, NativeWindowMouseEventArgs e)
 {
     viewer.mouseEventFunction(e);
     viewer.computeMouseMotion(e.Location.X, e.Location.Y);
 }
Exemple #8
0
 private void MouseWheel(object sender, NativeWindowMouseEventArgs e)
 {
     Subject.Notify(NotifyType.MouseScroll, new MouseWheelNotifyArgs(e.WheelTicks, this));
 }
Exemple #9
0
 private void NativeWindowOnMouseEnter(object sender, NativeWindowMouseEventArgs e)
 {
     ignoreSingleMouseDelta = true;
 }
 private void OnMouseButtonUp(object sender, NativeWindowMouseEventArgs e)
 {
     // does not fire if the mouse goes out of the window area and is released
     _touchProcessor.OnPointerUp(1);
 }