Пример #1
0
 public static MouseState GetState()
 {
   if (Mouse._mouse == null)
     return Mouse.State;
   Mouse.POINT lpPoint = new Mouse.POINT();
   Mouse.GetCursorPos(out lpPoint);
   Point point = Mouse.Window.PointToClient(lpPoint.ToPoint());
   Mouse.State.X = point.X;
   Mouse.State.Y = point.Y;
   Mouse.State.LeftButton = Mouse._mouse[MouseButton.Left] ? ButtonState.Pressed : ButtonState.Released;
   Mouse.State.RightButton = Mouse._mouse[MouseButton.Right] ? ButtonState.Pressed : ButtonState.Released;
   Mouse.State.MiddleButton = Mouse._mouse[MouseButton.Middle] ? ButtonState.Pressed : ButtonState.Released;
   Mouse.State.ScrollWheelValue = (int) ((double) Mouse._mouse.WheelPrecise * 120.0);
   return Mouse.State;
 }
Пример #2
0
        public static MouseState GetState()
        {
            if (Mouse._mouse == null)
            {
                return(Mouse.State);
            }
            Mouse.POINT lpPoint = new Mouse.POINT();
            Mouse.GetCursorPos(out lpPoint);
            Point point = Mouse.Window.PointToClient(lpPoint.ToPoint());

            Mouse.State.X                = point.X;
            Mouse.State.Y                = point.Y;
            Mouse.State.LeftButton       = Mouse._mouse[MouseButton.Left] ? ButtonState.Pressed : ButtonState.Released;
            Mouse.State.RightButton      = Mouse._mouse[MouseButton.Right] ? ButtonState.Pressed : ButtonState.Released;
            Mouse.State.MiddleButton     = Mouse._mouse[MouseButton.Middle] ? ButtonState.Pressed : ButtonState.Released;
            Mouse.State.ScrollWheelValue = (int)((double)Mouse._mouse.WheelPrecise * 120.0);
            return(Mouse.State);
        }
Пример #3
0
 public static bool GetCursorPos(out Mouse.POINT lpPoint);