Revert "Add InputChannel API to disable forwarding events to the underyling device"

This reverts commit c4be5021116fd7f4944ac300056031b7d5be25be.

Signed-off-by: nvsickle <nvsickle@amazon.com>
This commit is contained in:
nvsickle
2021-07-01 14:05:51 -07:00
parent 042e465622
commit 8dc59a13da
2 changed files with 1 additions and 30 deletions
@@ -327,7 +327,7 @@ namespace AzFramework
break;
}
if (m_state != State::Idle && m_shouldDispatchEvents)
if (m_state != State::Idle)
{
bool hasBeenConsumed = false;
InputChannelNotificationBus::Broadcast(&InputChannelNotifications::OnInputChannelEvent,
@@ -350,22 +350,4 @@ namespace AzFramework
// Directly return the channel to the 'Idle' state
m_state = State::Idle;
}
////////////////////////////////////////////////////////////////////////////////////////////////
void InputChannel::SetUpdateEventsEnabled(bool enabled)
{
if (m_shouldDispatchEvents != enabled)
{
m_shouldDispatchEvents = enabled;
const InputChannelRequests::BusIdType busId(m_inputChannelId, m_inputDevice.GetInputDeviceId().GetIndex());
if (enabled)
{
InputChannelRequestBus::Handler::BusConnect(busId);
}
else
{
InputChannelRequestBus::Handler::BusDisconnect(busId);
}
}
}
} // namespace AzFramework
@@ -218,23 +218,12 @@ namespace AzFramework
//! \ref AzFramework::InputChannelRequests::ResetState
void ResetState() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! Sets whether or not the channel shall broadcast to the InputChannelNotificationBus when
//! its internal state is updated.
//! This can be disabled to allow for testing or synthetic events that aren't part of the
//! input system.
void SetUpdateEventsEnabled(bool enabled);
private:
////////////////////////////////////////////////////////////////////////////////////////////
// Variables
const InputChannelId m_inputChannelId; //!< Id of the input channel
const InputDevice& m_inputDevice; //!< Input device that owns the input channel
State m_state; //!< Current state of the input channel
//! If true, &InputChannelNotifications::OnInputChannelEvent will be fired when UpdateState
//! is called.
bool m_shouldDispatchEvents = true;
};
////////////////////////////////////////////////////////////////////////////////////////////////