public MouseState CreateMouseState(MouseState state) { Vector2 dpi = DpiManager.GetSystemDpiScalar(); MouseState newstate = new MouseState((int)(state.X / dpi.X), (int)(state.Y / dpi.Y), state.ScrollWheelValue, state.LeftButton, state.MiddleButton, state.RightButton, state.XButton1, state.XButton2); return newstate; }
public InputEventMouse(MouseEvent eventType, MouseButtonInternal button, int clicks, int x, int y, int mouseData, WinKeys modifiers) : base(modifiers) { Vector2 dpi = DpiManager.GetSystemDpiScalar(); m_eventType = eventType; m_button = button; m_clicks = clicks; m_x = (int)(x / dpi.X); //EngineVars.ScreenDPI.X); m_y = (int)(y / dpi.Y); //EngineVars.ScreenDPI.Y); m_mouseData = mouseData; }
public InputEventMouse(MouseEvent type, WinMouseButtons btn, int clicks, int x, int y, int data, WinKeys modifiers) : base(modifiers) { Vector2 dpi = DpiManager.GetSystemDpiScalar(); EventType = type; m_Buttons = btn; m_Clicks = clicks; X = (int)(x / dpi.X); Y = (int)(y / dpi.Y); m_MouseData = data; }
public InputEventMouse(MouseEvent type, WinMouseButtons btn, int clicks, int x, int y, int data, WinKeys modifiers) : base(modifiers) { var dpi = DpiManager.GetSystemDpiScalar(); EventType = type; _buttons = btn; _clicks = clicks; X = (int)(x / dpi.x); Y = (int)(y / dpi.y); _mouseData = data; }
public void Update(double totalTime, double frameTime) { _theTime = (float)totalTime; _mouseStateLast = _mouseState; _mouseState = MouseState.CreateWithDPI(DpiManager.GetSystemDpiScalar()); lock (_eventsNext) { _events.Clear(); foreach (var e in _eventsNext) { _events.Add(e); } _eventsNext.Clear(); } }
public void Update(double totalTime, double frameTime) { m_TheTime = (float)totalTime; m_MouseStateLast = m_MouseState; m_MouseState = m_WndProc.MouseState.CreateWithDPI(DpiManager.GetSystemDpiScalar()); lock (m_EventsNext) { m_Events.Clear(); foreach (InputEvent e in m_EventsNext) { m_Events.Add(e); } m_EventsNext.Clear(); } }