Esempio n. 1
0
        protected virtual void RaiseHwndMouseWheel(MesHwndMouseEventArgs args)
        {
            var handler = HwndMouseWheel;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Esempio n. 2
0
        protected virtual void RaiseHwndX1ButtonUp(MesHwndMouseEventArgs args)
        {
            var handler = HwndX1ButtonUp;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Esempio n. 3
0
        protected virtual void RaiseHwndX2ButtonDblClick(MesHwndMouseEventArgs args)
        {
            var handler = HwndX2ButtonDblClick;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Esempio n. 4
0
        private void ResetMouseState()
        {
            // We need to invoke events for any buttons that were pressed
            bool fireL  = _mouseState.LeftButton == MouseButtonState.Pressed;
            bool fireM  = _mouseState.MiddleButton == MouseButtonState.Pressed;
            bool fireR  = _mouseState.RightButton == MouseButtonState.Pressed;
            bool fireX1 = _mouseState.X1Button == MouseButtonState.Pressed;
            bool fireX2 = _mouseState.X2Button == MouseButtonState.Pressed;

            // Update the state of all of the buttons
            _mouseState.LeftButton   = MouseButtonState.Released;
            _mouseState.MiddleButton = MouseButtonState.Released;
            _mouseState.RightButton  = MouseButtonState.Released;
            _mouseState.X1Button     = MouseButtonState.Released;
            _mouseState.X2Button     = MouseButtonState.Released;

            // Fire any events
            var args = new MesHwndMouseEventArgs(_mouseState);

            if (fireL)
            {
                RaiseHwndLButtonUp(args);
            }
            if (fireM)
            {
                RaiseHwndMButtonUp(args);
            }
            if (fireR)
            {
                RaiseHwndRButtonUp(args);
            }
            if (fireX1)
            {
                RaiseHwndX1ButtonUp(args);
            }
            if (fireX2)
            {
                RaiseHwndX2ButtonUp(args);
            }

            // The mouse is no longer considered to be in our window
            _mouseInWindow = false;
        }