예제 #1
0
        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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }
예제 #5
0
 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;
 }
예제 #6
0
 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;
 }
예제 #7
0
 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;
 }
예제 #8
0
 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;
 }
예제 #9
0
 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;
 }
예제 #10
0
 public bool IsMouseButtonDown(MouseButtonInternal button)
 {
     if ((m_WndProc.MouseButtons(m_MouseStateThisFrame) & button) == button)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #11
0
 public bool IsMouseButtonUp(MouseButtonInternal button)
 {
     if (IsMouseButtonUp(button))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #12
0
 /// <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
                                       ));
 }
예제 #13
0
        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;
        }
예제 #14
0
        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;
        }
예제 #15
0
 /// <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
         ));
 }
예제 #16
0
파일: WndProc.cs 프로젝트: Crwth/UltimaXNA
 /// <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()
         ));
 }
예제 #17
0
 public bool IsMouseButtonUp(MouseButtonInternal button)
 {
     if (IsMouseButtonUp(button))
         return false;
     else
         return true;
 }
예제 #18
0
 public bool IsMouseButtonDown(MouseButtonInternal button)
 {
     if ((getMouseButtons(_mouseStateThisFrame) & button) == button)
         return true;
     else
         return false;
 }