Navigation
Unreal Engine C++ API Reference > Runtime > ApplicationCore > GenericPlatform
Inheritance Hierarchy
- IPlatformInputDeviceMapper
- FGenericPlatformInputDeviceMapper
References
Module | ApplicationCore |
Header | /Engine/Source/Runtime/ApplicationCore/Public/GenericPlatform/GenericPlatformInputDeviceMapper.h |
Include | #include "GenericPlatform/GenericPlatformInputDeviceMapper.h" |
Syntax
class IPlatformInputDeviceMapper
Remarks
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!
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
FInputDeviceId | LastInputDeviceId | Highest used input device id. |
![]() |
FPlatformUserId | LastPlatformUserId | Highest used platform user id. |
![]() |
TMap< FInputDeviceId, FPlatformInputDeviceState > | MappedInputDevices | A map of all input devices to their current state |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Virtual destructor |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
FInputDeviceId | Returns the next available input device id. This ID should be globally unique! | |
![]() |
FPlatformUserId | Allocates a new user id when a user becomes active, will return none if no more can be created | |
![]() ![]() |
void | Binds to any core delegates that the platform may broadcast. | |
![]() ![]() |
IPlatformInputDeviceMapper & | Get () |
Get the platform input device mapper |
![]() ![]() ![]() |
int32 | GetAllActiveUsers
(
TArray< FPlatformUserId >& OutUsers |
Get all currently active platform ids, anyone who has a mapped input device |
![]() ![]() ![]() |
int32 | GetAllConnectedInputDevices
(
TArray< FInputDeviceId >& OutInputDevices |
Gather all currently connected input devices |
![]() ![]() ![]() |
int32 | GetAllInputDevices
(
TArray< FInputDeviceId >& OutInputDevices |
Get all mapped input devices on this platform regardless of their connection state. |
![]() ![]() ![]() |
int32 | GetAllInputDevicesForUser
(
const FPlatformUserId UserId, |
Populates the OutInputDevices array with any InputDeviceID's that are mapped to the given platform user |
![]() ![]() |
FInputDeviceId | Returns the default device id used for things like keyboard/mouse input | |
![]() ![]() ![]() |
EInputDeviceConnectionState | GetInputDeviceConnectionState
(
const FInputDeviceId DeviceId |
Gets the connection state of the given input device. |
![]() ![]() |
FOnUserInputDeviceConnectionChange & | ||
![]() ![]() |
FOnUserInputDevicePairingChange & | ||
![]() |
FPlatformUserId | GetPlatformUserForUserIndex
(
int32 LocalUserIndex |
Remap the legacy platform LocalUserIndex (often the same as ControllerId) to a FPlatformUserId. |
![]() ![]() ![]() |
FInputDeviceId | GetPrimaryInputDeviceForUser
(
FPlatformUserId UserId |
Returns the primary input device used by a specific player, or INPUTDEVICEID_NONE if invalid |
![]() ![]() |
FPlatformUserId | Returns the 'Primary' Platform user for this platform. | |
![]() ![]() ![]() |
FPlatformUserId | GetUserForInputDevice
(
FInputDeviceId DeviceId |
Returns the platform user attached to this input device, or PLATFORMUSERID_NONE if invalid |
![]() ![]() |
FPlatformUserId | Returns the platform user id that is being used for unmapped input devices. | |
![]() |
int32 | GetUserIndexForPlatformUser
(
FPlatformUserId UserId |
Remap a FPlatformUserId to the legacy platform LocalUserIndex (often the same as ControllerId). |
![]() ![]() |
bool | Internal_ChangeInputDeviceUserMapping
(
FInputDeviceId DeviceId, |
Change the user mapping of the given input device from an old user to a new one. |
![]() ![]() |
bool | Internal_MapInputDeviceToUser
(
FInputDeviceId DeviceId, |
Maps the given Input Device to the given userID. |
![]() ![]() |
bool | Internal_SetInputDeviceConnectionState
(
FInputDeviceId DeviceId, |
Set the connection state of a given Input Device to something new. |
![]() ![]() ![]() |
bool | IsInputDeviceMappedToUnpairedUser
(
const FInputDeviceId InputDevice |
Returns true if the given input device is mapped to the unpaired platform user id. |
![]() ![]() ![]() |
bool | IsUnpairedUserId
(
const FPlatformUserId PlatformId |
Returns true if the given Platform User Id is the user for unpaired input devices on this platform. |
![]() ![]() |
bool | 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 | |
![]() |
void | OnUserLoginChangedEvent
(
bool bLoggedIn, |
Callback for when FCoreDelegates::OnUserLoginChangedEvent is broadcasted |
![]() |
bool | RemapControllerIdToPlatformUserAndDevice
(
int32 ControllerId, |
Remap the legacy "int32 ControllerId" to the updated FPlatformUserId and FInputDeviceId. |
![]() |
bool | RemapUserAndDeviceToControllerId
(
FPlatformUserId UserId, |
Functions to provide compatibility between the old "int32 ControllerId" and the new FPlatformUserId and FInputDeviceId structs. |
![]() ![]() |
bool | If true, than this device mapper will broadcast the older CoreDelegates as well as the new delegates. | |
![]() ![]() ![]() |
bool | 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. | |
![]() ![]() |
void | Unbind from any delegates that have been hooked into. |
Typedefs
Name | Description |
---|---|
FOnUserInputDeviceConnectionChange | Callback for handling an Input Device's connection state change. |
FOnUserInputDevicePairingChange | Callback for handling an Input Device pairing change. |
Constants
Name | Description |
---|---|
OnInputDeviceConnectionChange | Callback when input devices are disconnected/reconnected |
OnInputDevicePairingChange | Callback when an input device's owning platform user pairing changes |