blackberry/SDL — pull request #33 by jgranick (2012-11-04 19:29:57+00:00)
Title: Push BPS events using SDL_SysWMEvent

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.