Exemplo n.º 1
0
        private void OnMouseButton(MouseButtonEventArgs e)
        {
            MouseButtonType mouseButtonType;

            switch (e.ChangedButton)
            {
            case MouseButton.Left:
                mouseButtonType = MouseButtonType.Left;
                break;

            case MouseButton.Middle:
                mouseButtonType = MouseButtonType.Middle;
                break;

            case MouseButton.Right:
                mouseButtonType = MouseButtonType.Right;
                break;

            default:
                return;
            }

            var modifiers = GetModifiers(e);
            var mouseUp   = (e.ButtonState == MouseButtonState.Released);
            var point     = GetPixelPosition(e);

            managedCefBrowserAdapter.OnMouseButton((int)point.X, (int)point.Y, mouseButtonType, mouseUp, e.ClickCount, modifiers);
        }
Exemplo n.º 2
0
        private void OnMouseButton(MouseButtonEventArgs e)
        {
            // Cef currently only supports Left, Middle and Right button presses.
            if (e.ChangedButton > MouseButton.Right)
            {
                return;
            }

            var modifiers = GetModifiers(e);
            var mouseUp   = (e.ButtonState == MouseButtonState.Released);
            var point     = GetPixelPosition(e);

            if (managedCefBrowserAdapter != null)
            {
                managedCefBrowserAdapter.OnMouseButton((int)point.X, (int)point.Y, (int)e.ChangedButton, mouseUp, e.ClickCount, modifiers);
            }
        }