X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fblackberry%2Ffg_main_blackberry.c;h=65b5954a8b02148f014d75275525f3875e2f6a99;hb=fc0a807d20dfc5fed06b97bf11da51759392cc90;hp=52b36f81bccd62bc378ff9970141876e669eb021;hpb=1f67274c9ebf2ed21d6302af23175a24ed56c820;p=freeglut diff --git a/src/blackberry/fg_main_blackberry.c b/src/blackberry/fg_main_blackberry.c index 52b36f8..65b5954 100644 --- a/src/blackberry/fg_main_blackberry.c +++ b/src/blackberry/fg_main_blackberry.c @@ -157,7 +157,7 @@ fg_time_t fgPlatformSystemTime ( void ) * Does the magic required to relinquish the CPU until something interesting * happens. */ -void fgPlatformSleepForEvents( uint64_t msec ) +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) { @@ -283,6 +283,7 @@ void fgPlatformProcessSingleEvent ( void ) { mtouch_event_t touchEvent; screen_get_mtouch_event(screenEvent, &touchEvent, 0); + LOGI("fgPlatformProcessSingleEvent: SCREEN_EVENT_MTOUCH_*: Type: 0x%X, X: %d, Y: %d, Contact Id: %d", SLOG2_FA_SIGNED(eventType), SLOG2_FA_SIGNED(touchEvent.x), SLOG2_FA_SIGNED(touchEvent.y), SLOG2_FA_SIGNED(touchEvent.contact_id), SLOG2_FA_END); if(touchEvent.contact_id == 0) { int size[2]; screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); @@ -320,6 +321,8 @@ void fgPlatformProcessSingleEvent ( void ) int size[2]; screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); + LOGI("fgPlatformProcessSingleEvent: SCREEN_EVENT_POINTER: Buttons: 0x%X, X: %d, Y: %d, Wheel: %d", SLOG2_FA_SIGNED(buttons), SLOG2_FA_SIGNED(position[0]), SLOG2_FA_SIGNED(position[1]), SLOG2_FA_SIGNED(wheel), SLOG2_FA_END); + //XXX Should multitouch be handled? // Handle left mouse. Interpret as touch if the left mouse event is not consumed. @@ -384,7 +387,7 @@ void fgPlatformProcessSingleEvent ( void ) screen_get_event_property_iv(screenEvent, SCREEN_PROPERTY_KEY_SYM, &value); LOGI("fgPlatformProcessSingleEvent: SCREEN_EVENT_KEYBOARD. Flags: 0x%X, Sym: 0x%X", SLOG2_FA_SIGNED(flags), SLOG2_FA_SIGNED(value), SLOG2_FA_END); // Suppress key repeats if desired - if (!fgStructure.CurrentWindow->State.IgnoreKeyRepeat && (flags & KEY_REPEAT) == 0) { + if ((flags & KEY_REPEAT) == 0 || (fgState.KeyRepeat == GLUT_KEY_REPEAT_ON && !fgStructure.CurrentWindow->State.IgnoreKeyRepeat)) { unsigned int keypress = 0; unsigned char ascii = 0; if ((keypress = key_special(value))) { @@ -403,9 +406,14 @@ void fgPlatformProcessSingleEvent ( void ) } break; } + + default: + LOGW("fgPlatformProcessSingleEvent: unknown screen event: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_END); + break; } } else if (domain == navigator_get_domain()) { - switch (bps_event_get_code(event)) { + int eventType = bps_event_get_code(event); + switch (eventType) { case NAVIGATOR_WINDOW_STATE: { @@ -422,6 +430,9 @@ void fgPlatformProcessSingleEvent ( void ) LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_WINDOW_STATE-NAVIGATOR_WINDOW_THUMBNAIL/NAVIGATOR_WINDOW_INVISIBLE", SLOG2_FA_END); INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_PAUSE)); break; + default: + LOGW("fgPlatformProcessSingleEvent: NAVIGATOR_WINDOW_STATE unknown: 0x%X", SLOG2_FA_SIGNED(state), SLOG2_FA_END); + break; } break; } @@ -434,10 +445,14 @@ void fgPlatformProcessSingleEvent ( void ) if (window != NULL) { fgDestroyWindow(window); } else { - LOGI("NAVIGATOR_EXIT: No current window", SLOG2_FA_END); + LOGW("NAVIGATOR_EXIT: No current window", SLOG2_FA_END); } } break; + + default: + LOGW("fgPlatformProcessSingleEvent: unknown navigator event: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_END); + break; } } }