Navigation
API > API/Runtime > API/Runtime/ApplicationCore > API/Runtime/ApplicationCore/IPlatformInputDeviceMapper
Description
Remap the legacy "int32 ControllerId" to the updated FPlatformUserId and FInputDeviceId. Use this function to add compatibility to platforms that may not have implemented this device mapper yet.
This is useful for functions such as FGenericApplicationMessageHandler::OnControllerAnalog that used to use the "int32 ControllerId" as a parameter so that you can call the new FGenericApplicationMessageHandler that take in a PlatformUserId and an InputDeviceId.
Derived Overrides
| Name | RemapControllerIdToPlatformUserAndDevice |
| Type | function |
| Header File | /Engine/Source/Runtime/ApplicationCore/Public/GenericPlatform/GenericPlatformInputDeviceMapper.h |
| Include Path | #include "GenericPlatform/GenericPlatformInputDeviceMapper.h" |
bool RemapControllerIdToPlatformUserAndDevice
(
int32 ControllerId,
FPlatformUserId & InOutUserId,
FInputDeviceId & OutInputDeviceId
)
True if this maps to a real user
Parameters
| Name | Remarks |
|---|---|
| ControllerId | The old plain "int32" that represented gamepad id or user index depending on the context. |
| InOutUserId | If the old function provides a PlatformId then pass it here, otherwise pass PLATFORMUSERID_NONE. |
| OutInputDeviceId | The best guess for an InputDeviceId based on the legacy int32 ControllerId. This may be INPUTDEVICEID_NONE. |