UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TInputDeviceMap< TDeviceKeyType > Class Template Reference

#include <GenericInputDeviceMap.h>

Public Member Functions

 TInputDeviceMap ()=default
 
 ~TInputDeviceMap ()=default
 
FInputDeviceId GetOrCreateDeviceId (const TDeviceKeyType &DeviceKey)
 
FInputDeviceId MapDefaultInputDevice (const TDeviceKeyType &DeviceKey)
 
FInputDeviceId FindDeviceId (const TDeviceKeyType &DeviceKey) const
 
FInputDeviceId FindDeviceIdChecked (const TDeviceKeyType &DeviceKey) const
 
const TDeviceKeyTypeGetDeviceKeyChecked (const FInputDeviceId DeviceId) const
 
const TDeviceKeyTypeFindDeviceKey (const FInputDeviceId DeviceId) const
 

Protected Attributes

TMap< TDeviceKeyType, FInputDeviceIdMappedDeviceIds
 
TMap< FInputDeviceId, TDeviceKeyTypeMappedIdToKey
 

Detailed Description

template<class TDeviceKeyType>
class TInputDeviceMap< TDeviceKeyType >

An interface which can be added to any IInputDevice (or any other type which is creating Human Interface Devices) to store it's unique identifier for those physical devices and associate them with a FInputDeviceId so that the rest of the Unreal Engine can interact with them

Some input interfaces use simple int32's to identify input devices, while others may have more specific GUID types types which are needed.

Constructor & Destructor Documentation

◆ TInputDeviceMap()

◆ ~TInputDeviceMap()

template<class TDeviceKeyType >
TInputDeviceMap< TDeviceKeyType >::~TInputDeviceMap ( )
default

Member Function Documentation

◆ FindDeviceId()

template<class TDeviceKeyType >
FInputDeviceId TInputDeviceMap< TDeviceKeyType >::FindDeviceId ( const TDeviceKeyType DeviceKey) const
inline

Returns the FInputDeviceId for the given device key.

Returns FInputDeviceId::Invalid if it is not yet mapped.

◆ FindDeviceIdChecked()

template<class TDeviceKeyType >
FInputDeviceId TInputDeviceMap< TDeviceKeyType >::FindDeviceIdChecked ( const TDeviceKeyType DeviceKey) const
inline

Returns the FInputDeviceId associated with the given device key. Asserts if not found.

◆ FindDeviceKey()

template<class TDeviceKeyType >
const TDeviceKeyType * TInputDeviceMap< TDeviceKeyType >::FindDeviceKey ( const FInputDeviceId  DeviceId) const
inline

Returns the device key for the given FInputDeviceId. Nullptr if not found.

◆ GetDeviceKeyChecked()

template<class TDeviceKeyType >
const TDeviceKeyType & TInputDeviceMap< TDeviceKeyType >::GetDeviceKeyChecked ( const FInputDeviceId  DeviceId) const
inline

Returns the device key for the given FInputDeviceId. Nullptr if not found.

◆ GetOrCreateDeviceId()

template<class TDeviceKeyType >
FInputDeviceId TInputDeviceMap< TDeviceKeyType >::GetOrCreateDeviceId ( const TDeviceKeyType DeviceKey)
inline

Given the DeviceKey, find it's associated FInputDeviceId.

If one does not exist yet, such as for a newly connected device, then create one from the IPlatformInputDeviceMapper.

◆ MapDefaultInputDevice()

template<class TDeviceKeyType >
FInputDeviceId TInputDeviceMap< TDeviceKeyType >::MapDefaultInputDevice ( const TDeviceKeyType DeviceKey)
inline

Maps a DeviceKey to the default FInputDeviceId which has the internal value 0. Returns the default FInputDeviceId for straightforward use.

Member Data Documentation

◆ MappedDeviceIds

template<class TDeviceKeyType >
TMap<TDeviceKeyType, FInputDeviceId> TInputDeviceMap< TDeviceKeyType >::MappedDeviceIds
protected

Map of the assigned DeviceKeyType to their assigned FInputDeviceId's from the engine.

◆ MappedIdToKey

template<class TDeviceKeyType >
TMap<FInputDeviceId, TDeviceKeyType> TInputDeviceMap< TDeviceKeyType >::MappedIdToKey
protected

A map of the assigned FInputDeviceId to their associated Device Key type for fast lookup.


The documentation for this class was generated from the following file: