Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

Disable forced Focus controller pairing


lv1
 Share

Recommended Posts

I'm working on a game for the Focus+ for a client that does not use controllers.  If you take off the headset during the game for a break that lasts more than a couple minutes then when you put the headset back on the Focus forces you to re-pair the controllers with the dreaded "Hold both controllers and make sure they are turned on" dialog.  This is strictly invoked by the Focus since it is trying to pair with the Focus controllers and even shows a graphic of them.  This causes us to carry around the controllers for no other reason than to re-pair them and then put them away.

I accept that these controllers are critical for navigating the HTC Vive home so completely disabling them is not useful.  However while in a game that does not use controllers there should be a way to prevent this popup?  I've looked in the advanced Settings > More > Apps for a toggle and don't see one (a logical place for this if HTC is listening....).  The standard methods of setting the NumControllers=0 in the android manifest or calling wvr_SetInteractionMode(WVR_InteractionMode.WVR_InteractionMode_Gaze);  both work to eliminate the controller in the game, but fail to prevent the HTC Focus override to force re-pairing when the headset wakes up after the controller connection has timed out.

Assuming there is a way to disable the Focus dialog I have a method in-game for the player to exit and return to the Vive Home.  I haven't found a way to disable the Focus from imposing its pairing requirement.  Anyone find a solution for this? @Cotta @Tony PH Lin

Link to comment
Share on other sites

Hi @lv1

If you're sure you don't need the controller pairing UI to pop up at all, you can disable it for your app by the following procedure:

In AndroidManifest.xml, find <application> section, and add this line under it:
    <meta-data android:name="no_controller_pairing" android:value="true" />

It should help to solve your specific use-case problem.

Link to comment
Share on other sites

Thanks @Cotta! This works great and I wanted to expand on the answer here for others.  If you are writing a native app the manifest change above is all you need.  If you are building in Unity 2018 versions or newer the old way of modifying a template file no longer works.  I found 2 options that both work.

1. Export the project and open it in Android Studio.  Unity makes 2 manifest files and the one you want to modify is the unityLibrary/manifests/AndroidManifest.xml and add the above in the <application> section

2. You must implement a callback OnPostGenerateGradleAndroidProject in which you can edit the dynamically created manifest.  This is detailed in this excellent link but find the response referencing this callback.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

It shouldn't be necessary to modify androidmanifest dynamically, you should be able to edit the one in your project (e.g. to add permissions etc). Or you can avoid the manifest way of doing this and just call the api directly. 

wvr.Interop.WVR_SetInteractionMode(wvr.WVR_InteractionMode.WVR_InteractionMode_Gaze);

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...