You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope to use transparent(no background) webview2 page as UI layer over d3d layer, just like head up display in video game, mouse events are handled by UI layer if there is html element (e.g. button), otherwise passed to d3d layer.
Hey @libaracy - As mentioned #1004 will add support for this. In the meantime, if you control the content of the webpage (which it sounds like you do if you're building a HUD-type experience) you could track mouse-events in the javascript which don't hit a button, and then send those back up to the host app. You can add that script to the page itself or through ICoreWebView2::ExecuteScript, and then send the hit-test results to the host app using a host object (ICoreWebView2::AddHostObjectToScript) or web messaging.
Hi @champnic , thanks for your response. Yes, what I want is very close to HUD.
The solution you suggest is what I'm using now, I used to think it's bad for performance. After testing, it's acceptable. However it's not so convenient, it need special handling for popup/focus in webview. Anyway it will be nice if webview2 sdk can provide some function to do it. Thanks!
I hope to use transparent(no background) webview2 page as UI layer over d3d layer, just like head up display in video game, mouse events are handled by UI layer if there is html element (e.g. button), otherwise passed to d3d layer.
I'm using function ICoreWebView2CompositionController::SendMouseInput to forward mouse events, but no way to do hit-testing, so I wonder if webview2 can provide a function or any other approach.
There is a similar request #1004, no progress. I'm afraid it's not easy, it's also very helpful if you can tell me it's impossible, thanks!
The text was updated successfully, but these errors were encountered: