How to I use IXboxOneRumble?

I want to let my Xbox ONE Controller’s trigger vibrate. Not just the left/right motor.

The corresponding Interface IXboxOneRumble offers the 4-parameter function:

void SetMotorSpeeds(float lowFrequency, float highFrequency, float leftTrigger, float rightTrigger)

And I am debugging it like this:

var gamepad = XInputController.current;
Debug.Log("type " + gamepad.GetType());
if (gamepad.aButton.isPressed)
{
    Debug.Log("a pressed");
    if (gamepad is IXboxOneRumble rumble)
    {
        Debug.Log("is IXboxOneRumble!");
        rumble.SetMotorSpeeds(0f, 0f, 0f, 1f);
    }
    else if (gamepad is IDualMotorRumble rumble2)
    {
        Debug.Log("is IDualMotorRumble");
        rumble2.SetMotorSpeeds(1f, 1f);
    }
}

But it always says “IDualMotorRumble”. Windows detects my controller as an actual xbox ONE controller.
How do I use that IXboxOneRumble interface?

I am interested too, there is no documentation about it and many games have this feature

I mean I got curious because Sony added the Adaptive Triggers on the PS5. Then I realized Xbox One doesn’t have Adaptive Triggers, but at least Trigger Vibration (for years!).
I downloaded “Xbox Accessories App” and could successfully test the Trigger Motors. So Windows can do this. So should xinput.dll…

When I connect my controller Unity even says “Xbox One Controller” and not just “xbox controller”. So it correctly detects it. So I wonder why it doesn’t work :confused:

1 Like

same story

Haven’t tried it yet, but I’m curious as well. According to https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/manual/SupportedDevices.html:

So maybe targeting a UWP build?

1 Like

So is this still not a thing? The documentation page for an old version of InputSystem has this comment in it:

The current version of that page doesn’t mention impulse triggers in the Xbox section anymore.
In Unity’s source on Github, as far as I can see, there are no references to IXboxOneRumble either.

What’s the deal? Why is there no communication on how to use impulse triggers?

1 Like

The IXboxOneRumble.cs interface has been there since 2019 unchanged but I don’t think it is used anywhere.

Games like WRC 8 support the triggers on PC and it isn’t UWP.

I managed to get the trigger rumbling by putting X1nput.dll and Windows.Gaming.Input.dll in the Plugins folder. Problem is that rumble came through the triggers fine but you couldn’t rumble the standard rumble motors anymore

1 Like