Skip to content


Push BPS events using SDL_SysWMEvent #33

merged 1 commit into from

2 participants

Open Source Projects member

Hi again,

I apologize for how the diff turned out on this commit. I'm using GitHub for Windows instead of using GIT from a terminal directly, and I was running into some trouble.

This makes a small change to the SDL_SysWMmsg struct for PlayBook, and adds "handleCustomEvent" in the PlayBook events file.

When a BPS event comes through that is not a navigator or screen event, it can now be pushed up using SDL_SysWMEvent, so long as the developer has used SDL_EventState (SDL_SYSWMEVENT, SDL_ENABLE); in his code.

Then you can get the BPS event if you catch a SDL_SYSWMEVENT, then use (inEvent.syswm.msg)->event

Now you can use the sensor API, BBM and other platform services while still using SDL. This seemed like the right place to put it, since SDL_SysWMEvent is platform-specific. Strictly speaking, I wouldn't consider BPS a window manager event, but using the existing SDL API in this way seemed like the cleanest way to handle other kinds of BPS events higher up the chain.

Open Source Projects member

It definitely seems like the right place. Otherwise people would have to spawn a new thread to handle these events, I suppose. I'm guessing the diff is flagging line-ending differences somewhere and that's why the whole file is considered different. I checked the diff on my machine and it looks fine.

@jnicholl jnicholl merged commit 084e8d8 into blackberry:emulate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 4, 2012
  1. @jgranick
Something went wrong with that request. Please try again.