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
merged 1 commit into from
Jun 9, 2013
Merged

Misc SDL fixes #1264

merged 1 commit into from
Jun 9, 2013

Conversation

inolen
Copy link
Collaborator

@inolen inolen 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.

@@ -361,6 +362,9 @@ var LibrarySDL = {
},

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

 - Added misc SDL functions (SDL_GetKeyName, SDL_GetAppState, SDL_SetGammaRamp)
 - Added modifiers to test_sdl_key
@inolen
Copy link
Collaborator Author

inolen commented Jun 7, 2013

The return false convention only works when assigning directly to the on[event] property (I put up an example here: http://www.inolen.com/events.html).

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 sdl_keymod branch June 9, 2013 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants