Added keyboard states for BlackBerry
[freeglut] / src / blackberry / fg_main_blackberry.c
index f7b8f66..d16f315 100644 (file)
@@ -160,7 +160,7 @@ fg_time_t fgPlatformSystemTime ( void )
 void fgPlatformSleepForEvents( fg_time_t msec )
 {
     //XXX: Is this right? Is there a more direct way to access the context?
-    if(bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) {
+    if(fgStructure.CurrentWindow && bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) {
         LOGW("BPS couldn't get event");
     }
 }
@@ -457,10 +457,14 @@ void fgPlatformProcessSingleEvent ( void )
                 case NAVIGATOR_SWIPE_DOWN:
                 case NAVIGATOR_BACK:
                 case NAVIGATOR_WINDOW_ACTIVE:
+                case NAVIGATOR_WINDOW_INACTIVE:
+                case NAVIGATOR_KEYBOARD_STATE:
+                case NAVIGATOR_KEYBOARD_POSITION:
                 case NAVIGATOR_DEVICE_LOCK_STATE:
                 case NAVIGATOR_WINDOW_COVER:
                 case NAVIGATOR_WINDOW_COVER_ENTER:
                 case NAVIGATOR_WINDOW_COVER_EXIT:
+                case NAVIGATOR_APP_STATE:
                     //XXX Should probably do something with these
                     break;