Made sure that windows created on BlackBerry are registered as fullscreen, for now. Added more logging in fgPlatformProcessSingleEvent on BlackBerry. Better handling of key repeats on BlackBerry by taking into account global and window settings.

This commit is contained in:
Rcmaniac25 2013-09-05 22:44:44 -04:00
parent 5ec6164f24
commit 07555eb425
2 changed files with 20 additions and 4 deletions

View File

@ -283,6 +283,7 @@ void fgPlatformProcessSingleEvent ( void )
{ {
mtouch_event_t touchEvent; mtouch_event_t touchEvent;
screen_get_mtouch_event(screenEvent, &touchEvent, 0); 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) { if(touchEvent.contact_id == 0) {
int size[2]; int size[2];
screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size);
@ -320,6 +321,8 @@ void fgPlatformProcessSingleEvent ( void )
int size[2]; int size[2];
screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); 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? //XXX Should multitouch be handled?
// Handle left mouse. Interpret as touch if the left mouse event is not consumed. // 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); 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); 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 // 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 int keypress = 0;
unsigned char ascii = 0; unsigned char ascii = 0;
if ((keypress = key_special(value))) { if ((keypress = key_special(value))) {
@ -403,9 +406,14 @@ void fgPlatformProcessSingleEvent ( void )
} }
break; break;
} }
default:
LOGW("fgPlatformProcessSingleEvent: unknown screen event: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_END);
break;
} }
} else if (domain == navigator_get_domain()) { } 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: 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); LOGI("fgPlatformProcessSingleEvent: NAVIGATOR_WINDOW_STATE-NAVIGATOR_WINDOW_THUMBNAIL/NAVIGATOR_WINDOW_INVISIBLE", SLOG2_FA_END);
INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_PAUSE)); INVOKE_WCB(*window, AppStatus, (GLUT_APPSTATUS_PAUSE));
break; break;
default:
LOGW("fgPlatformProcessSingleEvent: NAVIGATOR_WINDOW_STATE unknown: 0x%X", SLOG2_FA_SIGNED(state), SLOG2_FA_END);
break;
} }
break; break;
} }
@ -434,10 +445,14 @@ void fgPlatformProcessSingleEvent ( void )
if (window != NULL) { if (window != NULL) {
fgDestroyWindow(window); fgDestroyWindow(window);
} else { } else {
LOGI("NAVIGATOR_EXIT: No current window", SLOG2_FA_END); LOGW("NAVIGATOR_EXIT: No current window", SLOG2_FA_END);
} }
} }
break; break;
default:
LOGW("fgPlatformProcessSingleEvent: unknown navigator event: 0x%X", SLOG2_FA_SIGNED(eventType), SLOG2_FA_END);
break;
} }
} }
} }

View File

@ -108,9 +108,10 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
/* Request window events */ /* Request window events */
screen_request_events(window->Window.pContext.screenContext); screen_request_events(window->Window.pContext.screenContext);
/* Save window */ /* Save window and set state */
window->Window.Handle = fgDisplay.pDisplay.single_native_window; window->Window.Handle = fgDisplay.pDisplay.single_native_window;
window->State.WorkMask |= GLUT_INIT_WORK; window->State.WorkMask |= GLUT_INIT_WORK;
window->State.IsFullscreen = GL_TRUE; //XXX Always fullscreen for now
/* Create context */ /* Create context */
fghChooseConfig(&window->Window.pContext.egl.Config); fghChooseConfig(&window->Window.pContext.egl.Config);