[SOLVED!] How to access Thumb Touch capacitive sensor on Quest 2 using Oculus XR plugin?

Hi. Is there a way to access thumbrest sensor of Quest 2 controllers using Oculus XR Plugin? It should be OculusUsages.thumbrest, but it always returns false.

Im using Unity 2019.4.16f1. Tried 1.6.1 and 1.10.0 versions of the Plugin.

Can someone help me?

If you’re using QuestLink (i.e. Testing in the editor) you won’t be able to read the thumbrest. This appears to be a limitation of QuestLink, maybe since it was designed for Quest 1, which doesn’t have the thumbrest. (Might want to file a bug with Oculus?)

If you’re running on device (Android build) you should be able to read the thumbrest, but I can’t remember if I’ve tried with OpenXR. It definitely works with the legacy OVRInput system.

Hi. Thanks. But Im using Oculus XR plugin. The Unity.XR.Oculus library.

I can get Thumbrest using 1.6.1 version and device.TryGetFeatureValue(CommonUsages.thumbTouch, out thumb) code. But device.TryGetFeatureValue(Unity.XR.Oculus.OculusUsages.thumbrest, out thumb) always return false in any version. In versions above 1.6.1 even CommonUsages.thumbTouch dont work.((

Can someone PLEASE tell me if Unity.XR.Oculus.OculusUsages.thumbrest is can be used somehow or is it bugged and dont work??

So Ive found a way to access ThumbTouch! Here is the code:

        InputDevice leftController = InputDevices.GetDeviceAtXRNode( XRNode.LeftHand);

        List<InputFeatureUsage> inputFeatures = new List<InputFeatureUsage>();
        leftController.TryGetFeatureUsages(inputFeatures);
        bool thumb;
        leftController.TryGetFeatureValue(inputFeatures[11].As<bool>(), out thumb);
        text.text = "11 ThumbTouch: " + thumb;

Its 11 index for Left controller and 10 index for Right!

1 Like

Thanks for spending time on this battou, for me the indexing was right=11 left=12.

Hello!!! I recommend use this if to avoid throw exception (from the function: .As)

        InputDevice leftController = InputDevices.GetDeviceAtXRNode( XRNode.LeftHand);

        List<InputFeatureUsage> inputFeatures = new List<InputFeatureUsage>();
        leftController.TryGetFeatureUsages(inputFeatures);
        bool thumb;


  //Avoid the exception of wrong object type comparassion. (because inputFeatures list returns a bool and a Vector2)
 if (inputFeatures[index].type == typeof(bool)){
        leftController.TryGetFeatureValue(inputFeatures[11].As<bool>(), out thumb);
        text.text = "11 ThumbTouch: " + thumb;
}