I enabled in Unity the OpenXR VR mode.

Then I enabled the HTC Vive interaction profile and others

After that I can see the world and I can get the Hand positions of the HTC Vive controller, but I can not get any input, How can I get for example the Trigger button press event?
I am using the following code:
private UnityEngine.XR.InputDevice inputDevice;
public bool isIndexTriggerPressed()
{
bool triggerValue = false;
inputDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.triggerButton, out triggerValue);
if ((!previousIndexTriggerPressed) && (triggerValue))
{
previousIndexTriggerPressed = triggerValue;
return true;
}
previousIndexTriggerPressed = triggerValue;
return false;
}
Is this the right code?, How can I get the trigger press event?

The only way that I get it to work was using directly the SteamVR Unity plugin.
I dragged the "[CameraRig]" object that is localized on the SteamVR/Prefabs directory, to my Scene.
I used the following code to get the inputs:
Dont forget the bindings Window -> SteamVR Input