![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GenericPlatformInputDeviceMapper.h>
Inheritance diagram for IPlatformInputDeviceMapper:Static Public Member Functions | |
| static APPLICATIONCORE_API IPlatformInputDeviceMapper & | Get () |
Protected Member Functions | |
| virtual APPLICATIONCORE_API void | BindCoreDelegates () |
| virtual APPLICATIONCORE_API void | UnbindCoreDelegates () |
| virtual void | OnUserLoginChangedEvent (bool bLoggedIn, int32 UserId, int32 UserIndex)=0 |
| virtual bool | IsUsingControllerIdAsUserId () const =0 |
| virtual APPLICATIONCORE_API bool | ShouldCreateUniqueUserForEachDevice () const |
| virtual bool | ShouldBroadcastLegacyDelegates () const =0 |
Base class to private a mapping of Platform Users (FPlatformUserID) to their associated available input devices (FInputDeviceID).
This will handle the allocation of the globally unique identifier of the FInputDeviceID, and allow overrides of how each platform maps input devices to their users. Some platforms may desire to have each new input device assigned to a different user, while others may want multiple input devices associated with a single user.
| IPlatformInputDeviceMapper::IPlatformInputDeviceMapper | ( | ) |
|
virtual |
Virtual destructor
|
pure virtual |
Returns the next available input device id. This ID should be globally unique!
Implemented in FGenericPlatformInputDeviceMapper.
|
pure virtual |
Allocates a new user id when a user becomes active, will return none if no more can be created
Implemented in FGenericPlatformInputDeviceMapper.
|
protectedvirtual |
Binds to any core delegates that the platform may broadcast. By default it is only the OnUserLoginChangedEvent delegate. Called during the constructor of this device mapper.
| IPlatformInputDeviceMapper::DECLARE_MULTICAST_DELEGATE_ThreeParams | ( | FOnUserInputDeviceConnectionChange | , |
| EInputDeviceConnectionState | , | ||
| FPlatformUserId | , | ||
| FInputDeviceId | |||
| ) |
Callback for handling an Input Device's connection state change.
| NewConnectionState | The new connection state of this device |
| FPlatformUserId | The User ID whose input device has changed |
| FInputDeviceId | The Input Device ID that has changed connection |
| IPlatformInputDeviceMapper::DECLARE_MULTICAST_DELEGATE_ThreeParams | ( | FOnUserInputDevicePairingChange | , |
| FInputDeviceId | , | ||
| FPlatformUserId | , | ||
| FPlatformUserId | |||
| ) |
Callback for handling an Input Device pairing change.
| FInputDeviceId | Input device ID |
| FPlatformUserId | The NewUserPlatformId |
| FPlatformUserId | The OldUserPlatformId |
|
static |
Get the platform input device mapper
|
virtual |
Get all currently active platform ids, anyone who has a mapped input device
| OutUsers | Array that will be populated with the platform users. |
|
virtual |
Gather all currently connected input devices
| OutInputDevices | Array of input devices to populate |
|
virtual |
Gather all currently connected input devices for specific user
| UserId | The Platform User to gather the input devices of. |
| OutInputDevices | Array of input device ID's that will be populated with the mapped devices. |
|
virtual |
Get all mapped input devices on this platform regardless of their connection state.
| OutInputDevices | Array of input devices to populate |
|
virtual |
Populates the OutInputDevices array with any InputDeviceID's that are mapped to the given platform user
| UserId | The Platform User to gather the input devices of. |
| OutInputDevices | Array of input device ID's that will be populated with the mapped devices. |
|
virtual |
|
pure virtual |
Returns the default device id used for things like keyboard/mouse input
Implemented in FGenericPlatformInputDeviceMapper.
|
virtual |
Finds the first FPlatformUserId which was already allocated with no input devices.
Returns PLATFORMUSERID_NONE if every current platform user has a valid input device mapped to it.
Will not return the Unpaired platform user.
|
virtual |
Gets the connection state of the given input device.
| DeviceId | The device to get the connection state of |
|
virtual |
Returns the max allowed number of platform users this platform can have.
By default, this will return the value specified in the input settings ini file
|
inline |
|
inline |
|
virtual |
Returns the platform user id that a newly connected device should be mapped to.
If "ShouldCreateUniqueUserForEachDevice" is true, then a new platform user id will be allocated for this device. Otherwise, this will return the primary platform user.
| InUserId | An optional user index which can be passed in. If this is not -1, and IsUsingControllerIdAsUserId is true, then the platform user id for that user will be returned. |
|
pure virtual |
Implemented in FGenericPlatformInputDeviceMapper.
|
virtual |
Returns the primary input device used by a specific player, or INPUTDEVICEID_NONE if invalid
|
pure virtual |
Returns the 'Primary' Platform user for this platform. This typically has an internal ID of '0' and is used as the default platform user to map devices such as the keyboard and mouse that don't get assigned unique ID's from their owning platform code.
Implemented in FGenericPlatformInputDeviceMapper.
|
virtual |
Returns the platform user attached to this input device, or PLATFORMUSERID_NONE if invalid
|
pure virtual |
Returns the platform user id that is being used for unmapped input devices. Will be PLATFORMUSERID_NONE if platform does not support this (this is the default behavior)
Implemented in FGenericPlatformInputDeviceMapper.
|
pure virtual |
Implemented in FGenericPlatformInputDeviceMapper.
|
virtual |
Change the user mapping of the given input device from an old user to a new one. This will broadcast the OnInputDevicePairingChange delegate. Use this when you know that an input device is already mapped, but it has changed platform users This should be called by the platform's implementation.
| DeviceId | The input device to change the owner on |
| NewUserId | The new platform user that this input device should be mapped to |
| OldUserId | The old platform user that this input device is currently mapped to |
|
virtual |
Maps the given Input Device to the given userID. This will broadcast the OnInputDeviceConnectionChange delegate. This should be called by the platform's implementation.
| DeviceId | The device id to map |
| UserId | The Platform User that owns the given device |
| ConnectionState | The connection state of the device |
|
virtual |
Set the connection state of a given Input Device to something new. This will broadcast the OnInputDeviceConnectionChange delegate. This should be called by the platform's implementation.
| DeviceId | The device id that has had a connection change |
| NewState | The new connection state of the given device |
|
virtual |
Returns true if the given input device is mapped to the unpaired platform user id.
|
virtual |
Returns true if the given Platform User Id is the user for unpaired input devices on this platform.
|
protectedpure virtual |
If true, this device mapper is operating in a backward compatible mode where there is a 1:1 mapping between controller id and user id
Implemented in FGenericPlatformInputDeviceMapper.
|
protectedpure virtual |
Callback for when FCoreDelegates::OnUserLoginChangedEvent is broadcasted
Implemented in FGenericPlatformInputDeviceMapper.
|
pure virtual |
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.
| 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. |
Implemented in FGenericPlatformInputDeviceMapper.
|
pure virtual |
Remap a FPlatformUserId to a ControllerId that is needed by legacy code. Use this function to add compatibility to platforms that may not have implemented this device mapper yet.
| UserId | The platform user that should be converted |
| OutControllerId | Set to the old plain "int32" that represented gamepad id or user index depending on the context. |
| OptionalDeviceId | Set this to a specific device id if known |
Implemented in FGenericPlatformInputDeviceMapper.
|
protectedpure virtual |
If true, than this device mapper will broadcast the older CoreDelegates as well as the new delegates. Set this to true if your platform needs calls from OnControllerConnectionChange or OnControllerPairingChange
Implemented in FGenericPlatformInputDeviceMapper.
|
protectedvirtual |
If true, then when we remap the platform's raw int32 ControllerId to its FInputDeviceId and owning FPlatformUserId we should create a new platform user id if this controller id is not already mapped.
|
protectedvirtual |
Unbind from any delegates that have been hooked into. Called during the destructor of this device mapper.
|
protected |
Keeps track of any allocated platform user ID's by this device mapper.
|
protected |
Highest used input device id. Incremented in AllocateNewInputDeviceId and Internal_MapInputDeviceToUser by default.
|
protected |
Highest used platform user id. Incremented in AllocateNewUserId and Internal_MapInputDeviceToUser by default.
|
protected |
A map of all input devices to their current state
|
staticprotected |
Callback when input devices are disconnected/reconnected
|
staticprotected |
Callback when an input device's owning platform user pairing changes