Esempio n. 1
0
 /// <summary>
 /// Call this method each time the mouse is moved across the web view during
 /// a drag operation (after calling DragTargetDragEnter and before calling
 /// DragTargetDragLeave/DragTargetDrop).
 /// This method is only used when window rendering is disabled.
 /// </summary>
 public void DragTargetDragOver(CefMouseEvent mouseEvent, CefDragOperationsMask allowedOps)
 {
     var n_mouseEvent = mouseEvent.ToNative();
     cef_browser_host_t.drag_target_drag_over(_self, &n_mouseEvent, allowedOps);
 }
Esempio n. 2
0
 /// <summary>
 /// Call this method when the user completes the drag operation by dropping
 /// the object onto the web view (after calling DragTargetDragEnter).
 /// The object being dropped is |drag_data|, given as an argument to
 /// the previous DragTargetDragEnter call.
 /// This method is only used when window rendering is disabled.
 /// </summary>
 public void DragTargetDrop(CefMouseEvent mouseEvent)
 {
     var n_mouseEvent = mouseEvent.ToNative();
     cef_browser_host_t.drag_target_drop(_self, &n_mouseEvent);
 }
Esempio n. 3
0
 /// <summary>
 /// Send a mouse move event to the browser. The |x| and |y| coordinates are
 /// relative to the upper-left corner of the view.
 /// </summary>
 public void SendMouseMoveEvent(CefMouseEvent @event, bool mouseLeave)
 {
     var n_event = @event.ToNative();
     cef_browser_host_t.send_mouse_move_event(_self, &n_event, mouseLeave ? 1 : 0);
 }
Esempio n. 4
0
 /// <summary>
 /// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
 /// relative to the upper-left corner of the view. The |deltaX| and |deltaY|
 /// values represent the movement delta in the X and Y directions respectively.
 /// In order to scroll inside select popups with window rendering disabled
 /// CefRenderHandler::GetScreenPoint should be implemented properly.
 /// </summary>
 public void SendMouseWheelEvent(CefMouseEvent @event, int deltaX, int deltaY)
 {
     var n_event = @event.ToNative();
     cef_browser_host_t.send_mouse_wheel_event(_self, &n_event, deltaX, deltaY);
 }
Esempio n. 5
0
 /// <summary>
 /// Send a mouse click event to the browser. The |x| and |y| coordinates are
 /// relative to the upper-left corner of the view.
 /// </summary>
 public void SendMouseClickEvent(CefMouseEvent @event, CefMouseButtonType type, bool mouseUp, int clickCount)
 {
     var n_event = @event.ToNative();
     cef_browser_host_t.send_mouse_click_event(_self, &n_event, type, mouseUp ? 1 : 0, clickCount);
 }
Esempio n. 6
0
 CefMouseEvent GetCurrentMouseEvent()
 {
     Vec2 pos = viewSize.ToVec2() * MousePosition;
     var mouseEvent = new CefMouseEvent( (int)pos.X, (int)pos.Y, GetCurrentKeyboardModifiers() );
     return mouseEvent;
 }
Esempio n. 7
0
 public void SendMouseWheel(int x, int y, int delta, bool isVertical)
 {
     if (this.Browser != null)
     {
         var host = this.Browser.GetHost();
         var mouseEvent = new CefMouseEvent { X = x, Y = y };
         host.SendMouseWheelEvent(mouseEvent, isVertical ? delta : 0, !isVertical ? delta : 0);
     }
 }
Esempio n. 8
0
        public void SendMouseUpDown(int x, int y, CefMouseButtonType button, bool isMouseUp)
        {
            if (this.Browser != null)
            {
                var host = this.Browser.GetHost();

                if (!isMouseUp)
                {
                    if (IsContinuousClick(x, y, button))
                    {
                        clickCount++;
                    }
                    else
                    {
                        clickCount = 1;
                    }
                }

                var mouseEvent = new CefMouseEvent { X = x, Y = y };
                host.SendMouseClickEvent(mouseEvent, button, isMouseUp, clickCount);

                lastClickPosX = x;
                lastClickPosY = y;
                lastClickButton = button;
                lastClickTime = DateTime.Now;
            }
        }
Esempio n. 9
0
        public void SendMouseMove(int x, int y, CefMouseButtonType button)
        {
            if (this.Browser != null)
            {
                var host = this.Browser.GetHost();
                var mouseEvent = new CefMouseEvent { X = x, Y = y };
                if (button == CefMouseButtonType.Left)
                {
                    mouseEvent.Modifiers = CefEventFlags.LeftMouseButton;
                }
                else if (button == CefMouseButtonType.Middle)
                {
                    mouseEvent.Modifiers = CefEventFlags.MiddleMouseButton;
                }
                else if (button == CefMouseButtonType.Right)
                {
                    mouseEvent.Modifiers = CefEventFlags.RightMouseButton;
                }

                host.SendMouseMoveEvent(mouseEvent, false);
            }
        }