Exemplo n.º 1
0
        private void OnMouseMove(float scaleX, float scaleY)
        {
            int x1, y1, x2, y2;

            GetBorders(out x1, out y1, out x2, out y2);

            bool mouseMove =
                (_mouseX != (_mouseX = (int)((Mouse.X - x1) / scaleX))) |
                (_mouseY != (_mouseY = (int)((Mouse.Y - y1) / scaleY)));

            if (mouseMove)
            {
                MouseButton  buttons = MouseButton.None;
                TkMouseState mouse   = Mouse.GetState();

                if (mouse.IsButtonDown(TkMouseButton.Left))
                {
                    buttons |= MouseButton.Left;
                }
                if (mouse.IsButtonDown(TkMouseButton.Right))
                {
                    buttons |= MouseButton.Right;
                }
                if (buttons != MouseButton.None)
                {
                    TopScreen?.MouseDrag(new ScreenEventArgs(_mouseX, _mouseY, buttons));
                }

                TopScreen?.MouseMove(new ScreenEventArgs(_mouseX, _mouseY, buttons));
            }
        }
Exemplo n.º 2
0
 private void OnMouseMove(object sender, ScreenEventArgs args)
 {
     if (args.Buttons != MouseButton.None)
     {
         TopScreen?.MouseDrag(args);
     }
     TopScreen?.MouseMove(args);
 }