+ break;
+ }
+
+ case NAVIGATOR_KEYBOARD_POSITION:
+ {
+ /* Occurs only when keyboard has opened or resizes */
+ LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_KEYBOARD_POSITION");
+
+ int keyboardOffset = navigator_event_get_keyboard_position(fgDisplay.pDisplay.event);
+ if(keyboardOffset == BPS_FAILURE) {
+ LOGW("fgPlatformProcessSingleEvent: NAVIGATOR_KEYBOARD_POSITION: getting keyboard offset failed");
+ } else {
+ /* keyboardOffset is the offset from the top of the screen to the top of the keyboard, AKA the size of the uncovered screen
+ We want the height of the keyboard. So instead of determining the orientation, getting the right display size, and subtracting;
+ we just get the keyboard height which may be slower but easier to understand and work with */
+ virtualkeyboard_get_height(&keyboardOffset);
+ fgPlatformHandleKeyboardHeight(window, keyboardOffset);
+ }
+ break;
+ }
+
+ case NAVIGATOR_DEVICE_LOCK_STATE:
+ break;
+
+ case NAVIGATOR_WINDOW_COVER:
+ case NAVIGATOR_WINDOW_COVER_ENTER:
+ case NAVIGATOR_WINDOW_COVER_EXIT:
+ /* BlackBerry specific. Let app status and window status take care of everything */
+ break;
+
+ case NAVIGATOR_APP_STATE:
+ /* Can do the same as NAVIGATOR_WINDOW_ACTIVE/NAVIGATOR_WINDOW_INACTIVE but
+ seems like it doesn't work when the app comes to the foreground. Might be a bug */
+ break;
+
+ case NAVIGATOR_ORIENTATION_SIZE:
+ LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_ORIENTATION_SIZE");
+
+ /* Get new window size */
+ window->State.pWState.newWidth = navigator_event_get_orientation_size_width(fgDisplay.pDisplay.event);
+ window->State.pWState.newHeight = navigator_event_get_orientation_size_height(fgDisplay.pDisplay.event);
+ break;
+#endif
+
+ case 0: //Doesn't exist in header, but shows up when keyboard shows and resizes
+ break;
+
+ default:
+ LOGW("fgPlatformProcessSingleEvent: unknown navigator event: 0x%X", SLOG2_FA_SIGNED(eventType));
+ break;
+ }
+ }
+#ifdef __PLAYBOOK__
+ /* While this could be used for non-PlayBook, BlackBerry 10 will still get navigator events, so use those. They are a bit more exact. */
+ else if(domain == virtualkeyboard_get_domain()) {
+ unsigned int eventType = bps_event_get_code(fgDisplay.pDisplay.event);
+ switch (eventType) {
+ case VIRTUALKEYBOARD_EVENT_VISIBLE:
+ LOGI("fgPlatformProcessSingleEvent: VIRTUALKEYBOARD_EVENT_VISIBLE");
+ if(window->State.pWState.keyboardOpen != GL_TRUE) {
+ window->State.pWState.keyboardOpen = GL_TRUE;
+ fgPlatformHandleKeyboardHeight(window, window->State.pWState.keyboardHeight);
+ }
+ break;
+
+ case VIRTUALKEYBOARD_EVENT_HIDDEN:
+ LOGI("fgPlatformProcessSingleEvent: VIRTUALKEYBOARD_EVENT_HIDDEN");
+ if(window->State.pWState.keyboardOpen != GL_FALSE) {
+ window->State.pWState.keyboardOpen = GL_FALSE;
+ fgPlatformHandleKeyboardHeight(window, 0);
+ }
+ break;
+
+ case VIRTUALKEYBOARD_EVENT_INFO:
+ LOGI("fgPlatformProcessSingleEvent: VIRTUALKEYBOARD_EVENT_INFO");
+ window->State.pWState.keyboardHeight = virtualkeyboard_event_get_height(fgDisplay.pDisplay.event);
+ if(window->State.pWState.keyboardOpen == GL_TRUE) {
+ fgPlatformHandleKeyboardHeight(window, window->State.pWState.keyboardHeight);
+ }
+ break;
+
+ default:
+ LOGW("fgPlatformProcessSingleEvent: unknown virtualkeyboard event: 0x%X", eventType);
+ break;