Add the InputActionHandler to your GameObject and select the Input Action Type Select (FRONT BUTTON)
or Menu (BACK BUTTON)
.
Configure if you want the events to trigger only if the GameObject is focused.
public void OnInputDown(BaseInputEventData inputEventData)
{
if (inputEventData.InputSource.SourceName.Contains("Stylus"))
{
// Stylus XR Input Down!!
// do stuff...
} else {
// Other Controller Input Down
// do stuff...
}
}