#include <InputDeviceGamepad.h>
Inherits AzFramework::InputDevice, InputHapticFeedbackRequestBus::Handler, and InputLightBarRequestBus::Handler.
Classes | |
struct | Button |
All the input channel ids that identify game-pad digital button input. More... | |
class | Implementation |
Base class for platform specific implementations of game-pad input devices. More... | |
struct | ThumbStickAxis1D |
All the input channel ids that identify game-pad thumb-stick 1D axis input. More... | |
struct | ThumbStickAxis2D |
All the input channel ids that identify game-pad thumb-stick 2D axis input. More... | |
struct | ThumbStickDirection |
All the input channel ids that identify game-pad thumb-stick directional input. More... | |
struct | Trigger |
All the input channel ids that identify game-pad analog trigger input. More... | |
Public Types | |
using | ImplementationFactory = Implementation *(InputDeviceGamepad &) |
Alias for the function type used to create a custom implementation for this input device. | |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (InputDeviceGamepad, AZ::SystemAllocator) | |
AZ_RTTI (InputDeviceGamepad, "{16652E28-4B60-4852-BBD0-CB6A2D1B7377}", InputDevice) | |
InputDeviceGamepad () | |
Constructor. | |
InputDeviceGamepad (AZ::u32 index) | |
InputDeviceGamepad (const InputDeviceId &inputDeviceId, ImplementationFactory implementationFactory=&Implementation::Create) | |
AZ_DISABLE_COPY_MOVE (InputDeviceGamepad) | |
~InputDeviceGamepad () override | |
Destructor. | |
LocalUserId | GetAssignedLocalUserId () const override |
AzFramework::InputDevice::GetAssignedLocalUserId | |
void | PromptLocalUserSignIn () const override |
AzFramework::InputDevice::PromptLocalUserSignIn | |
const InputChannelByIdMap & | GetInputChannelsById () const override |
AzFramework::InputDevice::GetInputChannelsById | |
bool | IsSupported () const override |
AzFramework::InputDevice::IsSupported | |
bool | IsConnected () const override |
AzFramework::InputDevice::IsConnected | |
void | GetPhysicalKeyOrButtonText (const InputChannelId &inputChannelId, AZStd::string &o_keyOrButtonText) const override |
AzFramework::InputDeviceRequests::GetPhysicalKeyOrButtonText | |
void | TickInputDevice () override |
AzFramework::InputDeviceRequests::TickInputDevice | |
void | SetVibration (float leftMotorSpeedNormalized, float rightMotorSpeedNormalized) override |
AzFramework::InputHapticFeedbackRequests::SetVibration | |
void | SetLightBarColor (const AZ::Color &color) override |
AzFramework::InputLightBarRequests::SetLightBarColor | |
void | ResetLightBarColor () override |
AzFramework::InputLightBarRequests::ResetLightBarColor | |
void | SetImplementation (AZStd::unique_ptr< Implementation > impl) |
Public Member Functions inherited from AzFramework::InputDevice | |
AZ_CLASS_ALLOCATOR (InputDevice, AZ::SystemAllocator) | |
AZ_RTTI (InputDevice, "{29F9FB6B-15CB-4DB4-9F36-DE7396B82F3D}") | |
InputDevice (const InputDeviceId &inputDeviceId) | |
AZ_DISABLE_COPY_MOVE (InputDevice) | |
~InputDevice () override | |
Destructor. | |
const InputDevice * | GetInputDevice () const final |
AzFramework::InputDeviceRequests::GetInputDevice | |
const InputDeviceId & | GetInputDeviceId () const |
virtual LocalUserId | GetAssignedLocalUserId () const |
virtual void | PromptLocalUserSignIn () const |
virtual const InputChannelByIdMap & | GetInputChannelsById () const =0 |
virtual bool | IsSupported () const =0 |
virtual bool | IsConnected () const =0 |
Static Public Member Functions | |
static bool | IsGamepadDevice (const InputDeviceId &inputDeviceId) |
static AZ::u32 | GetMaxSupportedGamepads () |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Member Functions inherited from AzFramework::InputDevice | |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Attributes | |
static constexpr const char * | Name {"gamepad"} |
The name used to identify any game-pad input device. | |
Protected Types | |
using | ButtonChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelDigital * > |
using | TriggerChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAnalog * > |
using | ThumbStickAxis1DChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAxis1D * > |
using | ThumbStickAxis2DChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAxis2D * > |
using | ThumbStickDirectionChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAnalog * > |
Protected Attributes | |
InputChannelByIdMap | m_allChannelsById |
All game-pad input channels by id. | |
ButtonChannelByIdMap | m_buttonChannelsById |
All digital button channels by id. | |
TriggerChannelByIdMap | m_triggerChannelsById |
All analog trigger channels by id. | |
ThumbStickAxis1DChannelByIdMap | m_thumbStickAxis1DChannelsById |
All thumb-stick axis 1D channels by id. | |
ThumbStickAxis2DChannelByIdMap | m_thumbStickAxis2DChannelsById |
All thumb-stick axis 2D channels by id. | |
ThumbStickDirectionChannelByIdMap | m_thumbStickDirectionChannelsById |
All thumb-stick direction channels by id. | |
static constexpr InputDeviceId | IdForIndex0 {Name, 0} |
static constexpr InputDeviceId | IdForIndex1 {Name, 1} |
static constexpr InputDeviceId | IdForIndex2 {Name, 2} |
static constexpr InputDeviceId | IdForIndex3 {Name, 3} |
static constexpr InputDeviceId | IdForIndexN (AZ::u32 n) |
Additional Inherited Members | |
Protected Member Functions inherited from AzFramework::InputDevice | |
void | BroadcastInputChannelEvent (const InputChannel &inputChannel) const |
void | BroadcastInputTextEvent (const AZStd::string &textUTF8) const |
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. | |
void | ResetInputChannelStates () |
Reset the state of all this input device's associated input channels. | |
Defines a generic game-pad input device, including the ids of all associated input channels. Platform specific implementations are defined as private implementations so that creating an instance of this generic class will work correctly on any platform supporting game-pad input, while providing access to the device name and associated channel ids on any platform through the 'null' implementation (primarily so that the editor can use them to setup input mappings).
|
protected |
Alias for verbose container class
|
explicit |
Constructor
[in] | index | Index of the game-pad device |
|
explicit |
Constructor
[in] | inputDeviceId | Id of the input device |
[in] | implementationFactory | Optional override of the default Implementation::Create |
|
overridevirtual |
AzFramework::InputDevice::GetAssignedLocalUserId
Reimplemented from AzFramework::InputDevice.
|
overridevirtual |
|
static |
Get the maximum number of gamepads that are supported on the current platform
|
overridevirtual |
|
static |
Check whether an input device id identifies a gamepad (regardless of index)
[in] | inputDeviceId | The input device id to check |
|
overridevirtual |
|
overridevirtual |
AzFramework::InputDevice::PromptLocalUserSignIn
Reimplemented from AzFramework::InputDevice.
|
inline |
Set the implementation of this input device
[in] | implementation | The new implementation |
|
inlinestaticconstexpr |
The id used to identify a game-pad input device with a specific index