#include <InputChannel.h>
Inherits InputChannelRequestBus::Handler.
Inherited by AzFramework::InputChannelAnalog, AzFramework::InputChannelAxis2D, AzFramework::InputChannelAxis3D, AzFramework::InputChannelDelta, AzFramework::InputChannelDigital, AzFramework::InputChannelQuaternion, and AzFramework::InputMapping.
|
static void | Reflect (AZ::ReflectContext *context) |
|
Base class for all input channels that represent the current state of a single input source. Derived classes should provide additional functions that allow their parent input devices to update the state and value(s) of the input channel as raw input is received from the system, and they can (optionally) override the virtual GetCustomData function to return custom data.
◆ State
State of the input channel (not all channels will go through all states)
Enumerator |
---|
Idle | Examples: inactive or idle, not currently emitting input events.
|
Began | Examples: button pressed, trigger engaged, thumb-stick exits deadzone.
|
Updated | Examples: button held, trigger changed, thumb-stick is outside deadzone.
|
Ended | Examples: button released, trigger released, thumb-stick enters deadzone.
|
◆ InputChannel()
Constructor
- Parameters
-
[in] | inputChannelId | Id of the input channel |
[in] | inputDevice | Input device that owns the input channel |
◆ GetCustomData() [1/2]
virtual const CustomData * AzFramework::InputChannel::GetCustomData |
( |
| ) |
const |
|
virtual |
◆ GetCustomData() [2/2]
template<class CustomDataType >
const CustomDataType * AzFramework::InputChannel::GetCustomData |
|
inline |
Access to any custom data of a specific type provided by the input channel
- Template Parameters
-
CustomDataType | The specific type of custom data to be returned if it exists |
- Returns
- Pointer to the data if it exists and is of type CustomDataType, nullptr othewise
◆ GetDelta()
virtual float AzFramework::InputChannel::GetDelta |
( |
| ) |
const |
|
virtual |
◆ GetInputChannelId()
const InputChannelId & AzFramework::InputChannel::GetInputChannelId |
( |
| ) |
const |
Access to the input channel's id
- Returns
- Id of the input channel
◆ GetInputDevice()
const InputDevice & AzFramework::InputChannel::GetInputDevice |
( |
| ) |
const |
Access to the input channel's device
- Returns
- Input device that owns the input channel
◆ GetState()
State AzFramework::InputChannel::GetState |
( |
| ) |
const |
Direct access to the input channel's current state
- Returns
- The current state of the input channel
◆ GetValue()
virtual float AzFramework::InputChannel::GetValue |
( |
| ) |
const |
|
virtual |
◆ IsActive()
bool AzFramework::InputChannel::IsActive |
( |
| ) |
const |
Indirect access to the input channel's current state
- Returns
- True if the channel is in the 'Began' or 'Updated' states, false otherwise
◆ IsStateIdle()
bool AzFramework::InputChannel::IsStateIdle |
( |
| ) |
const |
Indirect access to the input channel's current state
- Returns
- True if the input channel is currently in the specified state, false otherwise
◆ UpdateState()
bool AzFramework::InputChannel::UpdateState |
( |
bool |
isChannelActive | ) |
|
Update the channel's state based on whether it is active/engaged or inactive/idle, which will broadcast an input event if the channel is left in a non-idle state. Should only be called a maximum of once per channel per frame from InputDeviceRequests::TickInputDevice to ensure input channels broadcast no more than one event each frame (at the same time).
- Parameters
-
[in] | isChannelActive | Whether the input channel is currently active/engaged |
- Returns
- Whether the update resulted in a state transition (was m_state changed)
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Input/Channels/InputChannel.h