Beispiel #1
0
        public void SendKeyEvent(KeyEvent keyEvent)
        {
            if (!IsBrowserInitialized)
            {
                return;
            }

            var sendToBrowser = true;

            if (keyEvent.Type == KeyEventType.KeyUp)
            {
                if (keyEvent.Modifiers.HasFlag(CefEventFlags.ControlDown))
                {
                    if (keyEvent.WindowsKeyCode == 'C' || keyEvent.WindowsKeyCode == 'c') // ctrl + c
                    {
                        CefBrowser.GetFocusedFrame().Copy();
                        sendToBrowser = false;
                    }
                }
            }

            if (sendToBrowser)
            {
                CefBrowser.GetBrowserHost().SendKeyEvent(keyEvent);
            }
        }
Beispiel #2
0
 public void SendMoveOrResizeStartedEvent()
 {
     if (IsBrowserInitialized)
     {
         CefBrowser.GetBrowserHost().NotifyMoveOrResizeStarted();
     }
 }
Beispiel #3
0
        public void SendMouseMoveEvent(int x, int y, MouseButtonType button)
        {
            if (!IsBrowserInitialized)
            {
                return;
            }

            var mouseEvent = mouseEventHelper.GetMouseEvent(x, y, button);

            CefBrowser.GetBrowserHost().SendMouseMoveEvent(mouseEvent, false);
        }
Beispiel #4
0
        public void SendMouseWheeleEvent(int x, int y, int delta, bool isVertical)
        {
            if (!IsBrowserInitialized)
            {
                return;
            }

            var deltaX     = !isVertical ? delta : 0; // horizontal scrolling
            var deltaY     = isVertical ? delta : 0;  // vertical scrolling
            var mouseEvent = mouseEventHelper.GetMouseEvent(x, y);

            CefBrowser.GetBrowserHost().SendMouseWheelEvent(mouseEvent, deltaX, deltaY);
        }
Beispiel #5
0
        public void SendMouseKeyEvent(int x, int y, MouseButtonType button, bool isKeyDown)
        {
            if (!IsBrowserInitialized)
            {
                return;
            }

            mouseEventHelper.ProcessClick(x, y, button, isKeyDown);
            var mouseClickCount = mouseEventHelper.ClickCount;
            var mouseEvent      = mouseEventHelper.GetMouseEvent(x, y, button);

            CefBrowser.GetBrowserHost().SendMouseClickEvent(mouseEvent, button, !isKeyDown, mouseClickCount);
        }