GameInput plugin wired behavior with DualSense gamepad

Hi,

We are trying to use GameInput plugin to process the input from DualSense gamepad. However we found that the D-pad of Dualsense gamepad is acting weirdly compared to other gamepads such as Xbox’s gamepads. When DualSense D-pad buttons are pressed, IE_Repeat events are fired instead of IE_Pressed events.

After a little digging, we found the logic below, inside function IGameInputDeviceProcessor::EvaluateSwitchState:

`// “Press” the current key
if (const TArrayFGamepadKeyNames::Type* CurrentKeyArray = UE::GameInput::SwitchPositionToUnrealName(CurrentPosition))
{
for (const FGamepadKeyNames::Type KeyName : *CurrentKeyArray)
{
UE_LOG(LogGameInput, Verbose, TEXT(“[EvaluateSwitchState] (PlatformUserId = %d, InputDeviceId = %d) - Switch ‘%s’ Pressed”), Params.PlatformUserId.GetInternalId(), Params.InputDeviceId.GetId(), *KeyName.ToString());
Params.MessageHandler->OnControllerButtonPressed(KeyName, Params.PlatformUserId, Params.InputDeviceId, true);
}

RepeatTimes[static_cast(CurrentPosition)] = CurrentTime + UE::GameInput::InitialRepeatDelay;
}`​

OnControllerButtonPressed is called with IsRepeat = true.

Comparing to the logic in IGameInputDeviceProcessor::EvaluateButtonStates, seems OnControllerButtonPressed should be called with IsRepeat = false when the button is pressed for the first time.

After changing this value from true to false, DualSense D-Pad works identically to other gamepads.

Is it a bug or is it an intend behavior? If it’s an intend behavior, do we have some ways to customize this behavior?

Regards,

Chang​

Hello [mention removed]​,

Sorry for the delay. I was able to reproduce this behavior locally in a project using a recent source build from the Main P4 stream, so the behavior is still present in UE 5.6 and later.

From my testing, the Xbox D-pad is handled as buttons by IGameInputDeviceProcessor and goes through EvaluateButtonStates, which sends the first press with bIsRepeat set to false. The DualSense D-pad is handled as a switch through EvaluateSwitchState, where the initial press is sent with bIsRepeat set to true. This value then propagates through the engine, so in InputKey the first actuation arrives as IE_Repeat instead of IE_Pressed.

This is inconsistent behavior and I consider it a bug. I will create a JIRA ticket to track it and share the details once it is filed.

In the meantime, you can continue using your current workaround.

Best,

Francisco

Hello [mention removed]​,

I’ve registered this issue as an engine bug and added it to the Unreal issue tracker. You can track the resolution through the following link:

Please note that Epic ultimately determines whether the issue will be made publicly accessible and the process may take a few days. The tracking link might not work immediately.

I’ll go ahead and close the case now but feel free to reply if you have anything else to add.

Best,

Francisco

Hello [mention removed] ,

Thank you for the reply and thank you for the confirmation.

Regards,

Chang