Develop

Input forwarding

Updated: Nov 18, 2026

Overview

Input forwarding eliminates the need to constantly put on and take off your headset during development. Move around your scene, click and drag on panels, and grab objects in your 3D scene using keyboard and mouse controls.
Here’s a quick example of what input forwarding looks like in action:

Setup

Input forwarding runs in the desktop cast window, so you need a way to start a cast. The Meta VR Plugin for Android Studio and Meta VR CLI are alternatives here. Each one stands on its own, and both start the same cast client with the same features, so everything after the launch step is the same whichever you choose.

Adding input forwarding

Sample projects already include this setup.
  1. In the [versions] block of your libs.versions.toml file, add a variable called spatialSDK if there isn’t one already.
     spatialsdk = "0.15.0"
    
  2. In the [libraries] block, add the cast input forward feature.
     meta-spatial-sdk-castinputforward = { group = "com.meta.spatial", name = "meta-spatial-sdk-castinputforward", version.ref = "spatialsdk" }
    
  3. In the dependencies {} block of app/build.gradle.kts, add the new dependency.
     dependencies {
         implementation(libs.meta.spatial.sdk.castinputforward)
     }
    
  4. In your app’s main activity file, add the CastInputForwardFeature to the registerFeatures() method.
       override fun registerFeatures(): List<SpatialFeature> {
         var features = ...
        if (BuildConfig.DEBUG) {
          features.add(CastInputForwardFeature(this))
        }
         return features
       }
    
    CastInputForwardFeature should never be included in release builds. The BuildConfig.DEBUG check ensures this feature only runs during development.

Using input forwarding

  1. Connect your headset
    Confirm the headset is attached. In Android Studio, it appears in the device dropdown in the toolbar. From a terminal, metavr device list prints the ID of each attached device.
  2. Start casting
    Choose either route. Both open the same cast window.
    • Android Studio: in the Meta VR tool window, select Cast on the Cast device row.
    • Meta VR CLI: start the cast from a terminal.
        metavr casting start
      
      metavr casting status reports whether the cast client is running, and metavr casting stop ends it.
  3. Run your app
    Make sure that you’re building a DEBUG flavor.
    • Android Studio: run your app with the Run ‘app’ button.
      Build and run in Android Studio
    • Meta VR CLI: install and launch a DEBUG APK you already built.
        metavr app install my-app.apk
        metavr app launch com.example.myapp
      
      See Work with devices and apps for the install and launch flags.
  4. Select the input forwarding icon while inside of your app to enable input forwarding.
Casting with input forwarding only works with your resolution set to Original (1:1). It will not work correctly if your resolution is set to Cropped (16:9) or Cinematic (16:9).
Note: The white cursor reflects the input forwarding controller’s interaction with the scene. This may not line up perfectly with where your mouse cursor is on the Cast window.

Controls

KeyAction
W / Up Arrow
Move forward
S / Down Arrow
Move backward
A
Move left
D
Move right
Q
Move up
E
Move down
Left Arrow
Rotate left
Right Arrow
Rotate right
Shift
Sprint
Left mouse button
Click
Ctrl + Left mouse button / Right mouse button
Hold to rotate view
Space + Left mouse button
Grab

Troubleshooting

Input forwarding has started, but there’s no cursor in app

Verify the following:
  • You are casting, and the cast window shows the input forwarding icon.
  • You have followed all the steps to include input forwarding to your app.
    • It must be added per-app.
    • CastInputForwardFeature should be one of the features you return in registerFeatures()
Your app is in general input forwarding mode if you experience slow movement, can leave the boundary, and see no input forwarding cursor. Spatial SDK needs a specific input forwarding mode to connect to your cast window.
Fix this by restarting your app and selecting the input forward icon in your Cast window again. In rare cases you may need to restart your Cast window as well.
Make sure you have added the <uses-native-library> tag for libossdk, as described in the Adding input forwarding section.