Search code examples
c++user-interfacechromium-embedded

chromium embedded detect button press


I want to use Chromium Embedded Framework as GUI of my OpenGL application.

I am using Off-screen Rendering.

How to detect when a HTML button/link is clicked on?

I tried to google this but with so generic search term there is only noise. The General Usage wiki also doesn't contain this.


Solution

  • I think you should catch an event in JS code and send a message to C++ code. It can be done using a message router described here: https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage#markdown-header-asynchronous-javascript-bindings

    It is also possible to implement a custom message router using JS integration mechanic: https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md