Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc SDL fixes #1264

merged 1 commit into from Jun 9, 2013


None yet
2 participants
Copy link

commented Jun 5, 2013

In addition to the changes in the commit message, I also converted the various document event handlers over to using addEventListener as opposed to assigning directly to the on[event] property.

While I'm not relying on this anymore, I believe at the time I was experimenting with some event binding in my shell that I didn't want to be inadvertently hulk-smashed by the SDL layer's event binding.


View changes

src/library_sdl.js Outdated
@@ -361,6 +362,9 @@ var LibrarySDL = {

receiveEvent: function(event) {
if (event.preventDefault) {
event.preventDefault(); // disable default processing (browser back on backspace, etc.)

This comment has been minimized.

Copy link

kripken Jun 7, 2013


We do return false to achieve what I think is the same thing?

Except we return true in unload, to not prevent tabs from closing.

- Fix for mod property of SDL key events
 - Added misc SDL functions (SDL_GetKeyName, SDL_GetAppState, SDL_SetGammaRamp)
 - Added modifiers to test_sdl_key

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 7, 2013

The return false convention only works when assigning directly to the on[event] property (I put up an example here:

However, I missed the unload event not needing to prevent the default action. I fixed that and cleaned up the unnecessary boolean return values.

@kripken kripken merged this pull request into emscripten-core:incoming Jun 9, 2013

@inolen inolen deleted the inolen:sdl_keymod branch Jun 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.