grab button in unity oculus vr

I can’t figure out how to call the grab button in unity for the oculus controllers. I have googled this topic for a while and can’t find any good results. if anyone could help me translate this into code it will be greatly appreciated. if (grab button is pressed)
{
stuff will happen
}

i figured it out but the answer was really stupid

var leftHandedControllers = new List<UnityEngine.XR.InputDevice>();
var ldesiredCharacteristics = UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Left | UnityEngine.XR.InputDeviceCharacteristics.Controller;
UnityEngine.XR.InputDevices.GetDevicesWithCharacteristics(ldesiredCharacteristics, leftHandedControllers);
if (leftHandedControllers.Count > 0)
{
targetdevicel = leftHandedControllers[0];
}

targetdevicel.TryGetFeatureValue(CommonUsages.gripButton, out bool lgripButtonValue);
if (lgripButtonValue)
{
leftgrip = true;
}
else
{
leftgrip = false;
}
var rightHandedControllers = new List<UnityEngine.XR.InputDevice>();
var rdesiredCharacteristics = UnityEngine.XR.InputDeviceCharacteristics.HeldInHand | UnityEngine.XR.InputDeviceCharacteristics.Right | UnityEngine.XR.InputDeviceCharacteristics.Controller;
UnityEngine.XR.InputDevices.GetDevicesWithCharacteristics(rdesiredCharacteristics, rightHandedControllers);
if (leftHandedControllers.Count > 0)
{
targetdevicel = rightHandedControllers[0];
}

targetdevicel.TryGetFeatureValue(CommonUsages.gripButton, out bool rgripButtonValue);
if (rgripButtonValue)
{
rightgrip = true;
}
else
{
rightgrip = false;
}