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::InputDeviceGamepad::Implementation Class Referenceabstract

Base class for platform specific implementations of game-pad input devices. More...

#include <InputDeviceGamepad.h>

Classes

struct  RawGamepadState
 Platform agnostic representation of a raw game-pad state. More...
 

Public Types

using DigitalButtonIdByBitMaskMap = AZStd::unordered_map< AZ::u32, const InputChannelId * >
 Alias for verbose container class.
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (Implementation, AZ::SystemAllocator)
 
 Implementation (InputDeviceGamepad &inputDevice)
 
 AZ_DISABLE_COPY_MOVE (Implementation)
 
virtual ~Implementation ()
 Destructor.
 
virtual LocalUserId GetAssignedLocalUserId () const
 
virtual void PromptLocalUserSignIn () const
 Prompt a local user sign-in request from this input device.
 
virtual bool IsConnected () const =0
 
virtual void SetVibration (float leftMotorSpeedNormalized, float rightMotorSpeedNormalized)=0
 
virtual void SetLightBarColor (const AZ::Color &color)
 
virtual void ResetLightBarColor ()
 Reset the light bar color of the gamepad (if one exists) to it's default.
 
virtual bool GetPhysicalKeyOrButtonText (const InputChannelId &, AZStd::string &) const
 
virtual void TickInputDevice ()=0
 Tick/update the input device to broadcast all input events since the last frame.
 
void BroadcastInputDeviceConnectedEvent () const
 Broadcast an event when the input device connects to the system.
 
void BroadcastInputDeviceDisconnectedEvent () const
 Broadcast an event when the input device disconnects from the system.
 

Static Public Member Functions

static ImplementationCreate (InputDeviceGamepad &inputDevice)
 

Protected Member Functions

void ProcessRawGamepadState (const RawGamepadState &rawGamepadState)
 
void ResetInputChannelStates ()
 Reset the state of all this input device's associated input channels.
 
AZ::u32 GetInputDeviceIndex () const
 AzFramework::InputDeviceId::GetIndex
 

Detailed Description

Base class for platform specific implementations of game-pad input devices.

Constructor & Destructor Documentation

◆ Implementation()

AzFramework::InputDeviceGamepad::Implementation::Implementation ( InputDeviceGamepad inputDevice)

Constructor

Parameters
[in]inputDeviceReference to the input device being implemented

Member Function Documentation

◆ Create()

static Implementation * AzFramework::InputDeviceGamepad::Implementation::Create ( InputDeviceGamepad inputDevice)
static

Default factory create function

Parameters
[in]inputDeviceReference to the input device being implemented

◆ GetAssignedLocalUserId()

virtual LocalUserId AzFramework::InputDeviceGamepad::Implementation::GetAssignedLocalUserId ( ) const
virtual

Access to the input device's currently assigned local user id

Returns
Id of the local user currently assigned to the input device

◆ GetPhysicalKeyOrButtonText()

virtual bool AzFramework::InputDeviceGamepad::Implementation::GetPhysicalKeyOrButtonText ( const InputChannelId ,
AZStd::string &   
) const
inlinevirtual

Get the text displayed on the physical key/button associated with an input channel.

Parameters
[in]inputChannelIdThe input channel id whose key or button text to return
[out]o_keyOrButtonTextThe text displayed on the physical key/button if found
Returns
True if o_keyOrButtonText was set, false otherwise

◆ IsConnected()

virtual bool AzFramework::InputDeviceGamepad::Implementation::IsConnected ( ) const
pure virtual

Query the connected state of the input device

Returns
True if the input device is currently connected, false otherwise

◆ ProcessRawGamepadState()

void AzFramework::InputDeviceGamepad::Implementation::ProcessRawGamepadState ( const RawGamepadState rawGamepadState)
protected

Process a game-pad state that has been obtained since the last call to this function. This function is not thread safe, and so should only be called from the main thread.

Parameters
[in]rawGamepadStateThe raw game-pad state

◆ SetLightBarColor()

virtual void AzFramework::InputDeviceGamepad::Implementation::SetLightBarColor ( const AZ::Color &  color)
inlinevirtual

Set the current light bar color of the gamepad (if one exists)

Parameters
[in]colorThe color to set the gamepad's light bar

◆ SetVibration()

virtual void AzFramework::InputDeviceGamepad::Implementation::SetVibration ( float  leftMotorSpeedNormalized,
float  rightMotorSpeedNormalized 
)
pure virtual

Set the current vibration (force-feedback) speed of the gamepads motors

Parameters
[in]leftMotorSpeedNormalizedSpeed of the left (large/low frequency) motor
[in]rightMotorSpeedNormalizedSpeed of the right (small/high frequency) motor

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