Skip to main content

Controller and Input Mapping

The Omni One treadmill, Pico Controllers, and Pico VR Headset are the main tools that users have at their disposal to interact with the virtual world when playing an Omni One game. Through controller/headset/Omni One actions, users are performing various operations within your VR game. For example, they can press the Back button to exit the current scene or game, press the Confirm button to make a setup, etc. Every controller/headset/Omni One action will be mapped to an input event. The Omni One SDK uses Unity's official keycodes for input event mapping.

Controller mapping

The Pico controllers' buttons use the keycodes provided by the Unity XR Input System.

The following figures display the buttons on each controller:

Unity Controller and HMD Input MappingUnity Controller and HMD Input Mapping

The table below describes the mappings between Pico 4 controller buttons and Unity XR keycodes:

ButtonUnity XR Keycode
MenuCommonUsages.menuButton
Trigger
Grip
CaptureN/A
Thumbstick
X/ACommonUsages.primaryButton
Y/BCommonUsages.secondaryButton

Retrieve button input values

You can retrieve the input values of physical controller buttons by specifying corresponding keycodes in InputDevice.TryGetFeatureValue. Below is an example API call:

//Gets whether the Trigger button has been pressed
bool triggerValue;
if (device.TryGetFeatureValue(UnityEngine.XR.CommonUsages.triggerButton, out triggerValue) && triggerValue)
{
Debug.Log("Trigger button is pressed.");
}

Headset input mappings

Pico 4

The following figure displays the buttons on the headset:

Unity Controller and HMD Input Mapping

The table below describes the mapping between Pico headset buttons and Unity/Android keys:

ButtonAndroid KeyRemarks
Volume UpVOLUME_UPA system-level Android key. Not open for modification.
Volume DownVOLUME_DOWNA system-level Android key. Not open for modification.

More keycodes

To learn other keycodes provided by the Unity XR Input System, refer to Unity's official article.

Add controller models

The Pico SDK packages a pair of controller models that you can access from Packages/PICO Integration/Assets/Resources/Prefabs. Based on the device model that users use, the shapes of these two models will change accordingly in the game.

You can also use custom controller models, such as pistols, bows, and wands, that best suit your game to bring users with a more immersive game experience.