Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::InputDeviceId Class Reference

Class that identifies a specific input device. More...

#include <InputDeviceId.h>

Public Member Functions

 AZ_CLASS_ALLOCATOR (InputDeviceId, AZ::SystemAllocator)
 
 AZ_TYPE_INFO (InputDeviceId, "{E58630A4-D380-4289-AA29-83300636A954}")
 
constexpr InputDeviceId (AZStd::string_view name, AZ::u32 index=0)
 
 AZ_DEFAULT_COPY_MOVE (InputDeviceId)
 
 ~InputDeviceId ()=default
 Default destructor.
 
constexpr const char * GetName () const
 
constexpr const AZ::Crc32 & GetNameCrc32 () const
 
constexpr AZ::u32 GetIndex () const
 
constexpr bool operator== (const InputDeviceId &other) const
 
constexpr bool operator!= (const InputDeviceId &other) const
 
constexpr bool operator< (const InputDeviceId &other) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Static Public Attributes

static constexpr int MAX_NAME_LENGTH = 64
 

Detailed Description

Class that identifies a specific input device.

Constructor & Destructor Documentation

◆ InputDeviceId()

constexpr AzFramework::InputDeviceId::InputDeviceId ( AZStd::string_view  name,
AZ::u32  index = 0 
)
inlineexplicitconstexpr

Constructor

Parameters
[in]nameName of the input device (will be truncated if exceeds MAX_NAME_LENGTH)
[in]indexIndex of the input device (optional)

Member Function Documentation

◆ GetIndex()

constexpr AZ::u32 AzFramework::InputDeviceId::GetIndex ( ) const
inlineconstexpr

Access to the input device's index. Used for differentiating between multiple instances of the same device type, regardless of whether the device has a local user id assigned. In some cases the device index and local user are the same, but this cannot be assumed. For example, by default the engine supports up to four gamepad devices that are created at startup using indicies 0->3. As gamepads connect/disconnect at runtime we assign the appropriate (system dependent) local user id (see InputDevice::GetAssignedLocalUserId).

Returns
Index of the input device

◆ GetName()

constexpr const char * AzFramework::InputDeviceId::GetName ( ) const
inlineconstexpr

Access to the input device's name

Returns
Name of the input device

◆ GetNameCrc32()

constexpr const AZ::Crc32 & AzFramework::InputDeviceId::GetNameCrc32 ( ) const
inlineconstexpr

Access to the crc32 of the input device's name

Returns
crc32 of the input device name

◆ operator!=()

constexpr bool AzFramework::InputDeviceId::operator!= ( const InputDeviceId other) const
inlineconstexpr

Inequality comparison operator

Parameters
[in]otherAnother instance of the class to compare for inequality

◆ operator<()

constexpr bool AzFramework::InputDeviceId::operator< ( const InputDeviceId other) const
inlineconstexpr

Less than comparison operator

Parameters
[in]otherAnother instance of the class to compare

◆ operator==()

constexpr bool AzFramework::InputDeviceId::operator== ( const InputDeviceId other) const
inlineconstexpr

Equality comparison operator

Parameters
[in]otherAnother instance of the class to compare for equality

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