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::InputMapping Class Referenceabstract

#include <InputMapping.h>

Inherits AzFramework::InputChannel.

Inherited by AzFramework::InputMappingAnd, and AzFramework::InputMappingOr.

Classes

class  ConfigBase
 Base class for input mapping configuration values that are exposed to the editor. More...
 
struct  EmptySnapshot
 Empty snapshot of an input channel used as the 'default' state for some input mappings. More...
 
struct  InputChannelNameFilteredByDeviceType
 Convenience class that allows for selection of an input channel name filtered by device. More...
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (InputMapping, AZ::SystemAllocator)
 
 AZ_RTTI (InputMapping, "{37CA842F-F6E4-47CD-947A-C9B82A2A4DA2}", InputChannel)
 
 InputMapping (const InputChannelId &inputChannelId, const InputContext &inputContext)
 
 AZ_DISABLE_COPY_MOVE (InputMapping)
 
 ~InputMapping () override=default
 Default Destructor.
 
bool ProcessPotentialSourceInputEvent (const InputChannel &inputChannel)
 
virtual void OnTick ()
 Tick/update the input mapping.
 
- Public Member Functions inherited from AzFramework::InputChannel
 AZ_CLASS_ALLOCATOR (InputChannel, AZ::SystemAllocator)
 
 AZ_RTTI (InputChannel, "{1C88625D-D297-4A1C-AE07-E17F88D138F3}")
 
 InputChannel (const InputChannelId &inputChannelId, const InputDevice &inputDevice)
 
 AZ_DISABLE_COPY_MOVE (InputChannel)
 
 ~InputChannel () override
 Destructor.
 
const InputChannelGetInputChannel () const final
 AzFramework::InputChannelRequests::GetInputChannel
 
const InputChannelIdGetInputChannelId () const
 
const InputDeviceGetInputDevice () const
 
State GetState () const
 
bool IsActive () const
 
virtual float GetValue () const
 
virtual float GetDelta () const
 
virtual const CustomDataGetCustomData () const
 
template<class CustomDataType >
const CustomDataType * GetCustomData () const
 
bool UpdateState (bool isChannelActive)
 
void ResetState () override
 AzFramework::InputChannelRequests::ResetState
 
bool IsStateIdle () const
 
bool IsStateBegan () const
 
bool IsStateUpdated () const
 
bool IsStateEnded () const
 

Protected Types

using SourceInputChannelIds = AZStd::unordered_set< InputChannelId >
 
using ActiveInputChannelIds = AZStd::unordered_map< InputChannelId, InputDeviceId >
 

Protected Member Functions

virtual bool IsSourceInput (const InputChannel &inputChannel)=0
 
virtual bool OnSourceInputEvent (const InputChannel &inputChannel)=0
 

Additional Inherited Members

- Public Types inherited from AzFramework::InputChannel
enum class  State { Idle , Began , Updated , Ended }
 State of the input channel (not all channels will go through all states) More...
 
using SharedPositionData2D = AZStd::shared_ptr< InputChannel::PositionData2D >
 Alias for verbose shared_ptr class.
 
- Static Public Member Functions inherited from AzFramework::InputChannel
static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Base class for all input mappings that listen for 'raw' input and output custom input events. Derived classes should provide additional functions that allow their parent input context to update the state and value(s) of the input mapping as raw input is received from the system, and they can (optionally) override the virtual GetCustomData function to return custom data.

Member Typedef Documentation

◆ SourceInputChannelIds

using AzFramework::InputMapping::SourceInputChannelIds = AZStd::unordered_set<InputChannelId>
protected

Alias for verbose container class

Constructor & Destructor Documentation

◆ InputMapping()

AzFramework::InputMapping::InputMapping ( const InputChannelId inputChannelId,
const InputContext inputContext 
)

Constructor

Parameters
[in]inputChannelIdId of the input mapping
[in]inputContextInput context that owns the input mapping

Member Function Documentation

◆ IsSourceInput()

virtual bool AzFramework::InputMapping::IsSourceInput ( const InputChannel inputChannel)
protectedpure virtual

Override to return whether an input channel is a source input for this input mapping.

Parameters
[in]inputChannelThe input channel that is a potential source input
Returns
True if the input channel is a source input, false otherwise

Implemented in AzFramework::InputMappingAnd, and AzFramework::InputMappingOr.

◆ OnSourceInputEvent()

virtual bool AzFramework::InputMapping::OnSourceInputEvent ( const InputChannel inputChannel)
protectedpure virtual

Override to be notified when a source input is active or its state or value is updated.

Parameters
[in]inputChannelThe input channel that is active or whose state or value updated
Returns
True if the input event has been consumed, false otherwise

Implemented in AzFramework::InputMappingAnd, and AzFramework::InputMappingOr.

◆ ProcessPotentialSourceInputEvent()

bool AzFramework::InputMapping::ProcessPotentialSourceInputEvent ( const InputChannel inputChannel)

Process a potential source input event, that will in turn call OnSourceInputEvent if the provided input channel is a source input for this input mapping.

Parameters
[in]inputChannelThe input channel that is a potential source input
Returns
True if the input is a source and the event has been consumed, false otherwise

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