Not sure if it will fix your problems, but in my code I'm adding all mouse- and touch-event-handlers to the WebGL canvas, and the keyboard events to the target window context.
https://github.com/floooh/sokol/blob/703b92078b152938f57fe3c02a1bcd73031159de/sokol_app.h#L2405-L2420 ...and then only forward specific keys to the browser (to avoid things like arrow-up/down keys scrolling the webpage): https://github.com/floooh/sokol/blob/703b92078b152938f57fe3c02a1bcd73031159de/sokol_app.h#L2127-L2190 ...it took a bit of trial and error to figure that all out though. Cheers, -Floh. On Monday, 27 May 2019 21:12:26 UTC+2, J Decker wrote: > > I have this C app, which shows a application window in an opengl context > on a canvas. > I have support for whether a mouse event is used or not, and just return > that status out... > When I click on the application form in the edit box, the form of course > 'uses' the mouse event to set focus to itself and show the I-bar, etc... > but becaues this mouse event gets consumed, the canvas control doesn't > actually get focus, so when I type it doesn't get any key input events. I > have to click in the blank area around the form where the mouse event is > not 'used', then I'm able to enter keys. > > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/a43142e6-a540-48c5-8da9-7ff1abe06f1f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
