Search Issue Tracker

Feature Request

Votes

0

Found in [Package]

0.1.2-preview

1.0.2

1.4.3

Issue ID

ISXB-331

Regression

No

Mouse delta events not captured on Android + Meta Quest when reaching the boundary of invisible Android "screen space"

Package: Input System

-

Reproduction steps:

# Open the user’s attached project (“UnityInputSystemMouseBug.zip”)
# Build And Run on an Oculus Quest device
# Connect a mouse through Bluetooth or USB-C adapter
# Keep moving the mouse to the right

Expected result: The MousePos increases infinitely
Actual result: The MousePos stops increasing

Reproducible with: 0.1.2-preview(2020.3.41f1), 1.0.2 (2021.1.12f1), 1.4.3(2022.1.21f1, 2022.2.0b12, 2023.1.0a16)

Reproducible with devices:
VLNQA00379, Oculus (Quest 2), Android 10, CPU: Snapdragon XR2, GPU: Adreno (TM) 650

Reproduced on: Windows 10 Enterprise 21H2

Notes:

* Locking the cursor’s position should fix the behavior, but it does not as the Cursor.lockState has no effect on Android in XR (See the commented code at /Assets/Scripts/MousePrintOut.cs line 50)
* This mouse behavior does not exist on any other platform (Desktop Windows, UWP on HoloLens, Windows MR, SteamVR), except on Quest+Android.
* This issue has been reported on the forums here: [https://forum.unity.com/threads/mouse-deltas-clamped-to-window-on-android.1296495/|https://forum.unity.com/threads/mouse-deltas-clamped-to-window-on-android.1296495/]
* The project uses OpenXR Plugin version 1.5.3

  1. Resolution Note:

    The problem is related to Android platform not having any implementation to support feature "Cursor lock", e.g. "https://docs.unity3d.com/ScriptReference/Cursor-lockState.html".
    A workaround was implemented to get mouse deltas for this use-case by extending UnityPlayerActivity and overriding dispatchGenericMotionEvent and dispatchTouchEvent to capture mouse velocities.
    MotionEvents are injected back into the Unity activity so that Input System continues to work normally.
    In order to get this to work as expected without additional effort "cursor lock" support and capture based mouse delta tracking needs to be implemented for Android which have been filed in Product Board as a feature request: https://unity.productboard.com/insights/notes/view/7046-unprocessed/notes/28091572

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.