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); } }
public void SendMoveOrResizeStartedEvent() { if (IsBrowserInitialized) { CefBrowser.GetBrowserHost().NotifyMoveOrResizeStarted(); } }
public void SendMouseMoveEvent(int x, int y, MouseButtonType button) { if (!IsBrowserInitialized) { return; } var mouseEvent = mouseEventHelper.GetMouseEvent(x, y, button); CefBrowser.GetBrowserHost().SendMouseMoveEvent(mouseEvent, false); }
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); }
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); }