private MouseButtonInternal translateWParamIntoMouseButtons(int wParam) { MouseButtonInternal mb = MouseButtonInternal.None; if ((wParam & 0x0001) == 0x0001) { mb |= MouseButtonInternal.Left; } if ((wParam & 0x0002) == 0x0002) { mb |= MouseButtonInternal.Right; } if ((wParam & 0x0002) == 0x0010) { mb |= MouseButtonInternal.Middle; } if ((wParam & 0x0002) == 0x0020) { mb |= MouseButtonInternal.XButton1; } if ((wParam & 0x0002) == 0x0040) { mb |= MouseButtonInternal.XButton2; } return(mb); }
/// <summary> /// Gets the current pressed Mouse Buttons /// </summary> public MouseButtonInternal MouseButtons(MouseState state) { MouseButtonInternal none = MouseButtonInternal.None; if (state.LeftButton == ButtonState.Pressed) { none |= MouseButtonInternal.Left; } if (state.RightButton == ButtonState.Pressed) { none |= MouseButtonInternal.Right; } if (state.MiddleButton == ButtonState.Pressed) { none |= MouseButtonInternal.Middle; } if (state.XButton1 == ButtonState.Pressed) { none |= MouseButtonInternal.XButton1; } if (state.XButton2 == ButtonState.Pressed) { none |= MouseButtonInternal.XButton2; } return(none); }
public EventArgsMouse(MouseButtonInternal button, int clicks, int x, int y, int mouseData, WinKeys modifiers) : base(modifiers) { _button = button; _clicks = clicks; _x = x; _y = y; _mouseData = mouseData; }
public InputEventMouse(MouseEvent eventType, MouseButtonInternal button, int clicks, int x, int y, int mouseData, WinKeys modifiers) : base(modifiers) { m_eventType = eventType; m_button = button; m_clicks = clicks; m_x = (int)(x / Settings.ScreenDPI.X); m_y = (int)(y / Settings.ScreenDPI.Y); m_mouseData = mouseData; }
public InputEventMouse(MouseEvent eventType, InputEventMouse parent) : base(parent) { m_eventType = eventType; m_button = parent.m_button; m_clicks = parent.m_clicks; m_x = parent.m_x; m_y = parent.m_y; m_mouseData = parent.m_mouseData; }
public InputEventMouse(MouseEvent eventType, MouseButtonInternal button, int clicks, int x, int y, int mouseData, WinKeys modifiers) : base(modifiers) { _eventType = eventType; _button = button; _clicks = clicks; _x = x; _y = y; _mouseData = mouseData; }
public InputEventMouse(MouseEvent eventType, InputEventMouse parent) : base(parent) { _eventType = eventType; _button = parent._button; _clicks = parent._clicks; _x = parent._x; _y = parent._y; _mouseData = parent._mouseData; }
public InputEventMouse(MouseEvent eventType, MouseButtonInternal button, int clicks, int x, int y, int mouseData, WinKeys modifiers) : base(modifiers) { m_eventType = eventType; m_button = button; m_clicks = clicks; m_x = (int)(x / UltimaVars.EngineVars.ScreenDPI.X); m_y = (int)(y / UltimaVars.EngineVars.ScreenDPI.Y); m_mouseData = mouseData; }
public bool IsMouseButtonDown(MouseButtonInternal button) { if ((m_WndProc.MouseButtons(m_MouseStateThisFrame) & button) == button) { return(true); } else { return(false); } }
public bool IsMouseButtonUp(MouseButtonInternal button) { if (IsMouseButtonUp(button)) { return(false); } else { return(true); } }
/// <summary> /// Reads the supplied message and executes any Mouse Up events required. /// </summary> /// <param name="message">The Message to parse</param> /// <param name="button">The Mouse Button the Message is for</param> /// <param name="clicks">The number of clicks for the Message</param> private void WmMouseUp(ref Message message, MouseButtonInternal button, int clicks) { // HandleMouseBindings(); invokeMouseUp(new InputEventMouse(MouseEvent.Up, button, clicks, Message.SignedLowWord(message.LParam), Message.SignedHighWord(message.LParam), (int)(long)message.WParam, ModifierKeys )); }
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 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; }
/// <summary> /// Reads the supplied message and executes any Mouse Up events required. /// </summary> /// <param name="message">The Message to parse</param> /// <param name="button">The Mouse Button the Message is for</param> /// <param name="clicks">The number of clicks for the Message</param> private void WmMouseUp(ref Message message, MouseButtonInternal button, int clicks) { // HandleMouseBindings(); OnMouseUp(new EventArgsMouse( button, clicks, Message.SignedLowWord(message.LParam), Message.SignedHighWord(message.LParam), (int)(long)message.WParam, getModifierKeys() )); }
public bool IsMouseButtonUp(MouseButtonInternal button) { if (IsMouseButtonUp(button)) return false; else return true; }
public bool IsMouseButtonDown(MouseButtonInternal button) { if ((getMouseButtons(_mouseStateThisFrame) & button) == button) return true; else return false; }