Exemplo n.º 1
0
 void UpdateMouse()
 {
     POINT p = new POINT();
     Functions.GetCursorPos(ref p);
     mouse.X = p.X;
     mouse.Y = p.Y;
     // Note: we cannot poll the mouse wheel
     mouse[MouseButton.Left] = (Functions.GetAsyncKeyState(VirtualKeys.LBUTTON) >> 8) != 0;
     mouse[MouseButton.Middle] = (Functions.GetAsyncKeyState(VirtualKeys.RBUTTON) >> 8) != 0;
     mouse[MouseButton.Right] = (Functions.GetAsyncKeyState(VirtualKeys.MBUTTON) >> 8) != 0;
     mouse[MouseButton.Button1] = (Functions.GetAsyncKeyState(VirtualKeys.XBUTTON1) >> 8) != 0;
     mouse[MouseButton.Button2] = (Functions.GetAsyncKeyState(VirtualKeys.XBUTTON2) >> 8) != 0;
 }
Exemplo n.º 2
0
 internal static extern BOOL GetCursorPos(ref POINT point);
Exemplo n.º 3
0
 public static extern HMONITOR MonitorFromPoint(POINT pt, MonitorFrom dwFlags);
Exemplo n.º 4
0
        public MouseState GetCursorState()
        {
            // For simplicity, get hardware state
            // and simply overwrite its x and y location
            POINT p = new POINT();
            Functions.GetCursorPos(ref p);

            var state = GetState();
            state.X = p.X;
            state.Y = p.Y;
            return state;
        }
Exemplo n.º 5
0
 private void UpdateMouse()
 {
     POINT point = new POINT();
       Functions.GetCursorPos(ref point);
       this.mouse.X = point.X;
       this.mouse.Y = point.Y;
       this.mouse[MouseButton.Left] = (int) Functions.GetAsyncKeyState(VirtualKeys.LBUTTON) >> 8 != 0;
       this.mouse[MouseButton.Middle] = (int) Functions.GetAsyncKeyState(VirtualKeys.RBUTTON) >> 8 != 0;
       this.mouse[MouseButton.Right] = (int) Functions.GetAsyncKeyState(VirtualKeys.MBUTTON) >> 8 != 0;
       this.mouse[MouseButton.Button1] = (int) Functions.GetAsyncKeyState(VirtualKeys.XBUTTON1) >> 8 != 0;
       this.mouse[MouseButton.Button2] = (int) Functions.GetAsyncKeyState(VirtualKeys.XBUTTON2) >> 8 != 0;
 }
Exemplo n.º 6
0
 public static IntPtr MonitorFromPoint(POINT pt, MonitorFrom dwFlags);
Exemplo n.º 7
0
 internal static bool GetCursorPos(ref POINT point);
Exemplo n.º 8
0
 internal static extern bool GetCursorPos(ref POINT point);