Browser not responding to other key events when using SDL

213 views
Skip to first unread message

Tomáš Rychnovský

unread,
Apr 26, 2014, 6:46:56 PM4/26/14
to emscripte...@googlegroups.com
Hi,

 whenever I run code (including examples) that use SDL, the browser (Firefox, Chrome) does not respond to any other key events. So, it is not possible to start debugger for example (CTRL+SHIFT+S in Firefox  or CTRL+SHIFT+J in Chrome). Also pressing Alt in Firefox deos not pop menu bar.

 When using for example glfw, instead of SDL, the browser is responding to key presses.

 Is there some way how to achieve the same when using SDL?

Thanks,
Tomas

Alon Zakai

unread,
Apr 29, 2014, 5:20:53 PM4/29/14
to emscripte...@googlegroups.com
The SDL behavior is usually better as you don't want keys to work normally in a game, you want to capture all key input yourself. So I suspect this is not intentional in glfw.

You can customize it in SDL by defining Module.doNotCaptureKeyboard which will not capture the keyboard at all. Or, you could not call preventDefault() in the handler, there isn't an option for that currently.

- Alon



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

m...@arello-mobile.com

unread,
Jul 31, 2014, 8:48:39 AM7/31/14
to emscripte...@googlegroups.com
Hi,

I have the same issue.
doNotCaptureKeyboard works and now I can scroll up/down with the arrow buttons. But scrolling up/down with mouse wheel does not work.
Any ideas how to enable that? Or do I have to mess with SDL internals? :(

Max
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

m...@arello-mobile.com

unread,
Jul 31, 2014, 10:04:14 AM7/31/14
to emscripte...@googlegroups.com
This is how currently looks:
Might take a while to load. Note that after app has been initialized you cannot scroll anymore.
Reply all
Reply to author
Forward
0 new messages