示例#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;
 }
示例#2
0
文件: API.cs 项目: jpbruyere/opentk
 internal static extern BOOL GetCursorPos(ref POINT point);
示例#3
0
文件: API.cs 项目: jpbruyere/opentk
 public static extern HMONITOR MonitorFromPoint(POINT pt, MonitorFrom dwFlags);
示例#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;
        }
示例#5
0
文件: WMInput.cs 项目: tanis2000/FEZ
 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;
 }
示例#6
0
 public static IntPtr MonitorFromPoint(POINT pt, MonitorFrom dwFlags);
示例#7
0
 internal static bool GetCursorPos(ref POINT point);
示例#8
0
 internal static extern bool GetCursorPos(ref POINT point);