private void OnMouseDown(object sender, MouseEventArgs e)
        {
            if (m_currentControl == null)
            {
                return;
            }

            switch (e.Button)
            {
            case MouseButtons.Left:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Left);
                break;

            case MouseButtons.Middle:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Middle);
                break;

            case MouseButtons.Right:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Right);
                break;

            case MouseButtons.XButton1:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Extended1);
                break;

            case MouseButtons.XButton2:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Extended2);
                break;
            }
        }
예제 #2
0
        private void OnRendererElement_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (m_rendererElement == null)
            {
                return;
            }

            m_rendererElement.Focus();

            switch (e.ChangedButton)
            {
            case System.Windows.Input.MouseButton.Left:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Left);
                break;

            case System.Windows.Input.MouseButton.Middle:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Middle);
                break;

            case System.Windows.Input.MouseButton.Right:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Right);
                break;

            case System.Windows.Input.MouseButton.XButton1:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Extended1);
                break;

            case System.Windows.Input.MouseButton.XButton2:
                m_stateMouseOrPointer.NotifyButtonDown(MouseButton.Extended2);
                break;
            }
        }