You can check your code against mine here: 
https://github.com/floooh/oryol/blob/master/code/Modules/Input/private/emsc/emscInputMgr.cc#L56

This is used for instance here (uses all sorts of mouse and keyboard 
input): http://floooh.github.io/oryol-samples/asmjs/ImGuiDemo.html

There are some caveats with the keyboard input, see here: 
https://github.com/floooh/oryol/blob/master/code/Modules/Input/private/emsc/emscInputMgr.cc#L253

The only thing that doesn't quite work currently is controlling Dear Imgui 
via touch input, button presses aren't properly registered, I'm not sure 
yet whether this is Imgui's fault, or my emscripten input handler code.

Hope this helps :)
-Floh.

Am Donnerstag, 5. Oktober 2017 21:37:23 UTC+2 schrieb Brian Gavin:
>
> In the past I had used EGL functions to create the webgl context.   I 
> wanted to added WebGL2 support so I switch to 
> using emscripten_webgl_create_context() instead to create the context.   It 
> works fine but my mouse messages/callbacks no longer fire when I click on 
> the canvas element.
>
> I use emscripten_set_mousedown_callback("#canvas", this, 1, MouseCB ); to 
> set the callback this used to work.   If I change it to NULL, it works 
> emscripten_set_mousedown_callback(NULL, this, 1, MouseCB );
>
> The problem with using null is that I get mouse messages for things I do 
> not want.   Is there something I am doing wrong?
>
> Thanks,
> Brian Gavin
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to