Exemplo n.º 1
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 HwndMouseEventArgs(_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;
        }
Exemplo n.º 2
0
 protected virtual void RaiseHwndMouseWheel(HwndMouseEventArgs args)
 {
     HwndMouseWheel?.Invoke(this, args);
 }
Exemplo n.º 3
0
 protected virtual void RaiseHwndMouseMove(HwndMouseEventArgs args)
 {
     HwndMouseMove?.Invoke(this, args);
 }
Exemplo n.º 4
0
 protected virtual void RaiseHwndX2ButtonDblClick(HwndMouseEventArgs args)
 {
     HwndX2ButtonDblClick?.Invoke(this, args);
 }
Exemplo n.º 5
0
 protected virtual void RaiseHwndX1ButtonUp(HwndMouseEventArgs args)
 {
     HwndX1ButtonUp?.Invoke(this, args);
 }
Exemplo n.º 6
0
 protected virtual void RaiseHwndMButtonDown(HwndMouseEventArgs args)
 {
     HwndMButtonDown?.Invoke(this, args);
 }