Skip to main content
Version: 20 Mar 2024

Input Binding Paths

Unity's Input System can locate Controls using paths. Bindings on Input Actions utilize this feature to identify the Control(s) they receive input from. You can also use paths to directly look up Controls and Devices, or to have the Input System search for Controls among all devices using the InputSystem.FindControls method.

This guide outlines the input paths and control profiles supported on Magic Leap 2. For general information about OpenXR Input in Unity, refer to the Unity OpenXR Plugin Input Manual.

Additional Resources:

Magic Leap Controller Profile

figure 1. Diagram that shows the location from which the position and rotation are reported for the controller and pointer pose.
NamePathTypeControlTypeInitialStateCheck
PointerPosition<MagicLeapController>/pointer/positionPassThroughVector3FALSE
PointerRotation<MagicLeapController>/pointer/rotationPassThroughQuaternionFALSE
Velocity<MagicLeapController>/devicePose/velocityPassThroughVector3FALSE
AngularVelocity<MagicLeapController>/devicePose/angularVelocityPassThroughVector3FALSE
MenuButton<MagicLeapController>/menuButtonButtonFALSE
Bumper<MagicLeapController>/gripPressedButtonButtonFALSE
Trigger<MagicLeapController>/triggerPressedButtonButtonFALSE
TriggerValue<MagicLeapController>/triggerValueAxisTRUE
Trackpad<MagicLeapController>/trackpadPassThroughVector2FALSE
TrackpadClick<MagicLeapController>/trackpadClickedPassThroughButtonFALSE
TrackpadTouch<MagicLeapController>/trackpadTouchedPassThroughButtonFALSE
TrackpadForce<MagicLeapController>/trackpadForcePassThroughAxisFALSE
Haptics<MagicLeapController>/hapticPassThroughHapticTRUE
Position<XRController>/devicePositionValueVector3FALSE
Rotation<XRController>/deviceRotationValueQuaternionFALSE
IsTracked<XRController>/isTrackedValueButtonTRUE
Status<XRController>/trackingStatePassThroughIntegerTRUE
info

To specify a input detect when the controller is being held in a specific hand instead of either, you can add {LeftHand} or {RightHand} after the <XRController> or <MagicLeapController> in the binding path.

Generic XR Bindings

Developers can also use the following Common Usage Bindings:

NamepathTypeControlTypeInitialStateCheckDescription
devicePosition<XRController>
/devicePosition
Vector3PositionFalseTracks the position of the device in 3D space.
deviceRotation<XRController>
/deviceRotation
QuaternionRotationFalseTracks the rotation of the device in 3D space.
deviceVelocity<XRController>
/deviceVelocity
Vector3VelocityFalseTracks the velocity of the device moving in 3D space.
deviceAngularVelocity<XRController>
/deviceAngularVelocity
Vector3AngularVelocityFalseTracks the angular velocity of the device rotating in 3D space.
trigger<XRController>
/trigger
floatAxisFalseRepresents the amount the trigger is pressed.
gripButton<XRController>
/gripButton
boolButtonFalseIndicates if the bumper button is pressed or not.
menuButton<XRController>
/menuButton
boolButtonFalseIndicates if the menu button is pressed or not.
primary2DAxisTouch<XRController>
/primary2DAxisTouch
boolTouchFalseIndicates if the primary 2D axis is being touched.
primary2DAxis<XRController>
/primary2DAxis
Vector2StickFalseTracks the movement of the touchpad on the 2D axis.

Khronos Simple Controller Profile

The Magic Leap 2 controller also supports the Khronos Simple Controller Profile which can be used to create cross platform input actions. These actions can be bound under the root <KHRSimpleController> path. To use the Khronos Controller profile bindings, see Unity's Khronos Controller Profile Documentation.