I am really a newbie here, and not a native English speaker, so....... Anyway, the CEF project is excellent, thank you!
Here is my problem.
I want to simulate mouse movement to the browser. and I didn't enable the off-screen draw feature.
it seems work when I call SendMouseMoveEvent immediately after the OnPageLoadEnd callback invoked. but doesn't work after doing some other stuff.
Why? Are there any points I didn't get from SendMouseMoveEvent?
Here is the c++ code:
- Code: Select all
if(frame->IsMain())
{
CefMouseEvent mouseEvent;
mouseEvent.x = 666;
mouseEvent.y = 666;
mBrowser->GetHost()->SendMouseMoveEvent(mouseEvent, false); // done with it
.... ...
And the HTML page:
- Code: Select all
<body>
<h1>Welcome to The Cef Monkey Script Engine</h1>
<h2>
it's a small monkey,hope you enjoy it!
<h2>
<p id="debug">it's test context</p>
</body>
<script>
document.onmousemove = function (e)
{
document.getElementById("debug").innerText ="The mouse location: ( " + e.pageX + ", " + e.pageY + " )";
}
</script>