IPlatformInputDeviceMapper::OnInputDeviceConnectionChange event return invalid FPlatformUserId in case of disconnection

Hello,

with the update to 5.6, we noticed that on PC, PS5 and XBox platforms, a popup we used to notify users of gamepad disconnection stopped working.

Upon investigation, we noticed that currently, in case of disconnection, the IPlatformInputDeviceMapper::OnInputDeviceConnectionChange event returns an invalid PlatformUserId because in the concerned input interfaces the association between FInputDeviceId and FPlatformUserId is nulled calling IPlatformInputDeviceMapper::Internal_MapInputDeviceToUser with IPlatformInputDeviceMapper::GetUserForUnpairedInputDevices as argument, and in Internal_MapInputDeviceToUser method the new values are cached before broadcasting the event.

Is this intended?

Are there any other ways to find out which user a disconnected controller was associated with?

Thank you for your kind help.

Best regards,

Leonardo

Hey there! Thank you for this report, I’ve created : Unreal Engine Issues and Bug Tracker (UE\-287887) for your tracking and also added some other related issues with input device connection events that should be solved as well.

The only work around would be the listen for the connection events, and store the platform user id -> Input device Id relationship in your code as needed.

Thanks,

Ben

Hi Ben,

thank you very much for your rapid response.

We have added a temp fix for now and we’ll track the issue you have created.

Have a nice day

Leonardo