EBus interface used to query for available input channels.
More...
#include <InputChannelRequestBus.h>
Inherits AZ::EBusTraits.
|
static const AZ::EBusAddressPolicy | AddressPolicy = AZ::EBusAddressPolicy::ById |
|
static const AZ::EBusHandlerPolicy | HandlerPolicy = AZ::EBusHandlerPolicy::Single |
| EBus Trait: requests should be handled by only one input channel connected to each id.
|
|
EBus interface used to query for available input channels.
◆ FindInputChannel()
static const InputChannel * AzFramework::InputChannelRequests::FindInputChannel |
( |
const InputChannelId & |
channelId, |
|
|
AZ::u32 |
deviceIndex = 0 |
|
) |
| |
|
static |
Finds a specific input channel given its id and the index of the device that owns it. This convenience function wraps an EBus call to InputChannelRequests::GetInputChannel.
- Parameters
-
[in] | channelId | Id of the input channel to find |
[in] | deviceIndex | Index of the device that owns the input channel |
- Returns
- Pointer to the input channel if it was found, nullptr if it was not
◆ GetInputChannel()
virtual const InputChannel * AzFramework::InputChannelRequests::GetInputChannel |
( |
| ) |
const |
|
pure virtual |
Returns the input channel uniquely identified by the id/index pair used to address calls. This should never be broadcast otherwise the channel returned will effectively be random.
Examples:
// Get the left mouse button input channel
const InputChannelRequests::BusIdType requestId(InputDeviceMouse::Button::Left);
const InputChannel* inputChannel = nullptr;
InputChannelRequestBus::EventResult(inputChannel,
requestId,
&InputChannelRequests::GetInputChannel);
// Get the A button input channel for the gamepad device at index 2
const InputChannelRequests::BusIdType requestId(InputDeviceGamepad::Button::A, 2);
const InputChannel* inputChannel = nullptr;
InputChannelRequestBus::EventResult(inputChannel,
requestId,
&InputChannelRequests::GetInputChannel);
- Returns
- Pointer to the input channel if it exists, nullptr otherwise
◆ ResetState()
virtual void AzFramework::InputChannelRequests::ResetState |
( |
| ) |
|
|
pure virtual |
Reset the channel's state, which should broadcast an 'Ended' input notification event (if the channel is currently active) before returning the channel to the idle state.
◆ SimulateRawInput()
virtual void AzFramework::InputChannelRequests::SimulateRawInput |
( |
float |
| ) |
|
|
inlinevirtual |
Simulate a raw input event. Please use with caution; it's designed primarily for testing purposes, and could result in strange behaviour if called while the user is interacting physically with any input device that happens to be updating the same input channel(s), or if used to simulate input of an input channel whose value is derived from the value of a different input channel (eg. the InputDeviceGamepad::ThumbStickDirection::* input channel values are derived from their respective InputDeviceGamepad::ThumbStickAxis2D).
If used, it is the responsibility of the caller to reset the input channel back to it's original idle state, otherwise it may be left in a state of being permanently 'active'.
- Parameters
-
[in] | rawValue | The raw input value to simulate. Analog input channels will use the value directly, digital input channels treat 0.0f as 'off' and all other values as 'on'. |
◆ SimulateRawInput2D()
virtual void AzFramework::InputChannelRequests::SimulateRawInput2D |
( |
float |
, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
Simulate a raw input event. Please use with caution; it's designed primarily for testing purposes, and could result in strange behaviour if called while the user is interacting physically with any input device that happens to be updating the same input channel(s), or if used to simulate input of an input channel whose value is derived from the value of a different input channel (eg. the InputDeviceGamepad::ThumbStickDirection::* input channel values are derived from their respective InputDeviceGamepad::ThumbStickAxis2D).
If used, it is the responsibility of the caller to reset the input channel back to it's original idle state, otherwise it may be left in a state of being permanently 'active'.
- Parameters
-
[in] | rawValueX | The raw x-axis input value to simulate. |
[in] | rawValueY | The raw y-axis input value to simulate. |
◆ SimulateRawInput3D()
virtual void AzFramework::InputChannelRequests::SimulateRawInput3D |
( |
float |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
Simulate a raw input event. Please use with caution; it's designed primarily for testing purposes, and could result in strange behaviour if called while the user is interacting physically with any input device that happens to be updating the same input channel(s), or if used to simulate input of an input channel whose value is derived from the value of a different input channel (eg. the InputDeviceGamepad::ThumbStickDirection::* input channel values are derived from their respective InputDeviceGamepad::ThumbStickAxis2D).
If used, it is the responsibility of the caller to reset the input channel back to it's original idle state, otherwise it may be left in a state of being permanently 'active'.
- Parameters
-
[in] | rawValueX | The raw x-axis input value to simulate. |
[in] | rawValueY | The raw y-axis input value to simulate. |
[in] | rawValueZ | The raw z-axis input value to simulate. |
◆ SimulateRawInputWithPosition2D()
virtual void AzFramework::InputChannelRequests::SimulateRawInputWithPosition2D |
( |
float |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
Simulate a raw input event. Please use with caution; it's designed primarily for testing purposes, and could result in strange behaviour if called while the user is interacting physically with any input device that happens to be updating the same input channel(s), or if used to simulate input of an input channel whose value is derived from the value of a different input channel (eg. the InputDeviceGamepad::ThumbStickDirection::* input channel values are derived from their respective InputDeviceGamepad::ThumbStickAxis2D).
If used, it is the responsibility of the caller to reset the input channel back to it's original idle state, otherwise it may be left in a state of being permanently 'active'.
- Parameters
-
[in] | rawValue | The raw input value to simulate. Analog input channels will use the value directly, digital input channels treat 0.0f as 'off' and all other values as 'on'. |
[in] | normalizedX | The normalized x position of the simulated raw input event. |
[in] | normalizedY | The normalized y position of the simulated raw input event. |
◆ AddressPolicy
const AZ::EBusAddressPolicy AzFramework::InputChannelRequests::AddressPolicy = AZ::EBusAddressPolicy::ById |
|
static |
EBus Trait: requests can be addressed to a specific InputChannelId so that they are only handled by one input channel that has connected to the bus using that unique id, or they can be broadcast to all input channels that have connected to the bus, regardless of id.
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Input/Buses/Requests/InputChannelRequestBus.h