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