Skip to content

Commit 736f949

Browse files
committed
Add SendMouseWheelEvent to WPF Control
Add SendMouseWheelEvent to IWebBrowser with xml comment
1 parent 59a91e1 commit 736f949

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CefSharp.Wpf/ChromiumWebBrowser.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,11 @@ protected override void OnMouseWheel(MouseWheelEventArgs e)
913913
}
914914
}
915915

916+
public void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY)
917+
{
918+
managedCefBrowserAdapter.OnMouseWheel(x, y, deltaX, deltaY);
919+
}
920+
916921
protected void PopupMouseEnter(object sender, MouseEventArgs e)
917922
{
918923
Focus();

CefSharp/IWebBrowser.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ public interface IWebBrowser : IDisposable
256256
/// <summary>
257257
/// Explicitly close the developer tools window if one exists for this browser instance.
258258
/// </summary>
259-
void CloseDevTools();
259+
void CloseDevTools();
260+
261+
/// <summary>
262+
/// Send a mouse wheel event to the browser.
263+
/// </summary>
264+
/// <param name="x">X-Axis coordinate relative to the upper-left corner of the view.</param>
265+
/// <param name="y">Y-Axis coordinate relative to the upper-left corner of the view.</param>
266+
/// <param name="deltaX">Movement delta for X direction.</param>
267+
/// <param name="deltaY">movement delta for Y direction.</param>
268+
void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY);
260269
}
261270
}

0 commit comments

Comments
 (0)