Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Gnometech's avatar
Gnometech
Start Partner
9 years ago

[GearVR] Oculus Patched UE4 4.10.2 Back Button Issues

Greetings!

I'm using the 4.10-0.8 branch from https://github.com/Oculus-VR/UnrealEngine as I need to be on Mobile SDk 1.x to launch my GearVR title. However, it looks like the Back button now behaves quite differently in this version compared to the standard UE4 4.10.4.

It is now not possible for the application to receive a Back button event, and it always attempts to quit the application. To test this out, I just recompiled by Circumpaint application using the Oculus branch. Now any short press of the Back button brings up the standard "Are you sure you want to quit" dialog.

In going through the new code in Engine/Plugins/Runtime/GearVR/Source/GearVR/Private/GearVR.cpp there are added HandleBackButtonAction() and HandleInputKey() methods. Within HandleInputKey(), if the Back button is released before BACK_BUTTON_SHORT_PRESS_TIME_IN_SECONDS is up, then we enter a short press state. So far, so good.

But then within HandleBackButtonAction() a pending Back button short press state has the following code:

	else if (BackButtonState == BACK_BUTTON_STATE_PENDING_SHORT_PRESS && !BackButtonDown)
{
if ( ( vrapi_GetTimeInSeconds() - BackButtonDownStartTime ) > BACK_BUTTON_DOUBLE_TAP_TIME_IN_SECONDS )
{
UE_LOG(LogHMD, Log, TEXT("back button short press"));

PushBlackFinal();

UE_LOG(LogHMD, Log, TEXT(" SystemActivities_StartSystemActivity( %s )"), ANSI_TO_TCHAR(PUI_CONFIRM_QUIT));
SystemActivities_StartSystemActivity( &JavaGT, PUI_CONFIRM_QUIT, NULL );
BackButtonState = BACK_BUTTON_STATE_NONE;
}
}


With this code, a Back button short press will always pop up the quit confirmation activity. This means that an application or game can never make use of the Back button to navigate back through its menus.

Is there a reason this is now forced on us? Or is it just an error? If it is an error, what would be the fix to pass a short press Back button back into UE4's input stream like we have in the standard 4.10.4?

Thanks!

- Dave

15 Replies

Replies have been turned off for this discussion