Navigation
API > API/Runtime > API/Runtime/ApplicationCore
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.
Keep any function comments up to date with those in PlatformInputDeviceMapperLibrary.h!
| Name | IPlatformInputDeviceMapper |
| Type | class |
| Header File | /Engine/Source/Runtime/ApplicationCore/Public/GenericPlatform/GenericPlatformInputDeviceMapper.h |
| Include Path | #include "GenericPlatform/GenericPlatformInputDeviceMapper.h" |
Syntax
class IPlatformInputDeviceMapper
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
IPlatformInputDeviceMapper() |
GenericPlatform/GenericPlatformInputDeviceMapper.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IPlatformInputDeviceMapper() |
Virtual destructor | GenericPlatform/GenericPlatformInputDeviceMapper.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnUserInputDeviceConnectionChange | TMulticastDelegate_ThreeParams< void, EInputDeviceConnectionState, FPlatformUserId, FInputDeviceId > | Callback for handling an Input Device's connection state change. | GenericPlatform/GenericPlatformInputDeviceMapper.h |
| FOnUserInputDevicePairingChange | TMulticastDelegate_ThreeParams< void, FInputDeviceId, FPlatformUserId, FPlatformUserId > | Callback for handling an Input Device pairing change. | GenericPlatform/GenericPlatformInputDeviceMapper.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| OnInputDeviceConnectionChange | FOnUserInputDeviceConnectionChange | Callback when input devices are disconnected/reconnected | GenericPlatform/GenericPlatformInputDeviceMapper.h |
| OnInputDevicePairingChange | FOnUserInputDevicePairingChange | Callback when an input device's owning platform user pairing changes | GenericPlatform/GenericPlatformInputDeviceMapper.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FInputDeviceId AllocateNewInputDeviceId() |
Returns the next available input device id. This ID should be globally unique! | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
FPlatformUserId AllocateNewUserId() |
Allocates a new user id when a user becomes active, will return none if no more can be created | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetAllActiveUsers
(
TArray< FPlatformUserId >& OutUsers |
Get all currently active platform ids, anyone who has a mapped input device | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetAllConnectedInputDevices
(
TArray< FInputDeviceId >& OutInputDevices |
Gather all currently connected input devices | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetAllConnectedInputDevicesForUser
(
const FPlatformUserId UserId, |
Gather all currently connected input devices for specific user | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetAllInputDevices
(
TArray< FInputDeviceId >& OutInputDevices |
Get all mapped input devices on this platform regardless of their connection state. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetAllInputDevicesForUser
(
const FPlatformUserId UserId, |
Populates the OutInputDevices array with any InputDeviceID's that are mapped to the given platform user | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual const EInputDeviceMappingPolicy GetCurrentDeviceMappingPolicy() |
GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
FInputDeviceId GetDefaultInputDevice() |
Returns the default device id used for things like keyboard/mouse input | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
| Finds the first FPlatformUserId which was already allocated with no input devices. | GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
virtual EInputDeviceConnectionState GetInputDeviceConnectionState
(
const FInputDeviceId DeviceId |
Gets the connection state of the given input device. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual int32 GetMaxPlatformUserCount () |
Returns the max allowed number of platform users this platform can have. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
FOnUserInputDeviceConnectionChange & GetOnInputDeviceConnectionChange() |
GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
FOnUserInputDevicePairingChange & GetOnInputDevicePairingChange() |
GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
virtual FPlatformUserId GetPlatformUserForNewlyConnectedDevice
(
const int32 InUserId |
Returns the platform user id that a newly connected device should be mapped to. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
FPlatformUserId GetPlatformUserForUserIndex
(
int32 LocalUserIndex |
Remap the legacy platform LocalUserIndex (often the same as ControllerId) to a FPlatformUserId. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual FInputDeviceId GetPrimaryInputDeviceForUser
(
FPlatformUserId UserId |
Returns the primary input device used by a specific player, or INPUTDEVICEID_NONE if invalid | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
| Returns the 'Primary' Platform user for this platform. | GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
virtual FPlatformUserId GetUserForInputDevice
(
FInputDeviceId DeviceId |
Returns the platform user attached to this input device, or PLATFORMUSERID_NONE if invalid | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
| Returns the platform user id that is being used for unmapped input devices. | GenericPlatform/GenericPlatformInputDeviceMapper.h | ||
int32 GetUserIndexForPlatformUser
(
FPlatformUserId UserId |
Remap a FPlatformUserId to the legacy platform LocalUserIndex (often the same as ControllerId). | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
void HandleInputDevicePolicyChanged
(
const EInputDeviceMappingPolicy NewPolicy |
Remaps the currently connected input devices based on the new given policy. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool Internal_ChangeInputDeviceUserMapping
(
FInputDeviceId DeviceId, |
Change the user mapping of the given input device from an old user to a new one. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool Internal_MapInputDeviceToUser
(
FInputDeviceId DeviceId, |
Maps the given Input Device to the given userID. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool Internal_SetInputDeviceConnectionState
(
FInputDeviceId DeviceId, |
Set the connection state of a given Input Device to something new. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool IsInputDeviceMappedToUnpairedUser
(
const FInputDeviceId InputDevice |
Returns true if the given input device is mapped to the unpaired platform user id. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool IsUnpairedUserId
(
const FPlatformUserId PlatformId |
Returns true if the given Platform User Id is the user for unpaired input devices on this platform. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
bool RemapControllerIdToPlatformUserAndDevice
(
int32 ControllerId, |
Remap the legacy "int32 ControllerId" to the updated FPlatformUserId and FInputDeviceId. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
bool RemapUserAndDeviceToControllerId
(
FPlatformUserId UserId, |
Functions to provide compatibility between the old "int32 ControllerId" and the new FPlatformUserId and FInputDeviceId structs. | GenericPlatform/GenericPlatformInputDeviceMapper.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BindCoreDelegates () |
Binds to any core delegates that the platform may broadcast. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
bool IsUsingControllerIdAsUserId() |
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 | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
void OnUserLoginChangedEvent
(
bool bLoggedIn, |
Callback for when FCoreDelegates::OnUserLoginChangedEvent is broadcasted | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
bool ShouldBroadcastLegacyDelegates () |
If true, than this device mapper will broadcast the older CoreDelegates as well as the new delegates. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual bool ShouldCreateUniqueUserForEachDevice() |
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. | GenericPlatform/GenericPlatformInputDeviceMapper.h | |
virtual void UnbindCoreDelegates () |
Unbind from any delegates that have been hooked into. | GenericPlatform/GenericPlatformInputDeviceMapper.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static IPlatformInputDeviceMapper & Get() |
Get the platform input device mapper | GenericPlatform/GenericPlatformInputDeviceMapper.h |