What do you need help with?

R7 Unity Plugin for handling input & input mode

Follow

Over the years, releases of Unity have handled input event support differently, and this has caused some problems for R-7 developers. Thru 2016 vintage Unity, it was possible for a Unity App to handle input events and mode control on the R-7. This article discusses input in Unity and provides examples:  Controlling-Input-Mode-programmatically-in-Unity-Applications

Later versions of Unity (2017 Unity and later) broke input events, so we developed an R-7 Unity pluginR7UnityPlugin.unitypackage to fix this. Below a link to a Unity plugin that allows you to switch cursor and mouse modes, and this should allow you to receive input events:

pluginR7UnityPlugin.unitypackage

The package contains an AAR that that hooks up to the java api to switch input modes and contains a sample where you can see a key handler script is calling:

osterhoutUnityPlugin.SetCursorMode(cursorMode); 

Make sure your R-7 is running ReticleOS 4.2.5 or later (latest is 4.3.8), and your your settings have the platform as Android. Make sure the odgplugin-debug.aar is in Android/libs directory. If your project has any other java libraries, you might need to export your project to gradle and use the gradle project to add the odg plugin library.

What is suppose to happen is the user can press the multi-function button (right temple, the button closest to your ear) to flip between cursor mode and selector mode. If in cursor mode, the cursor should appear on the display, and then the trackpad can be used to position the cursor to click on things. If in selector mode, the track pad will generate DPAD events.

 

Have more questions? Submit a request

Comments

Powered by Zendesk