Fix editor controls working in game mode

-Implements ResetInputChannels for ViewportController API and SetEnabled for ViewportControllerList
-Disables all viewport controllers while in game mode
This commit is contained in:
nvsickle
2021-04-20 12:31:10 -07:00
parent 7e2cbda2d3
commit 5ea2240787
9 changed files with 107 additions and 1 deletions
@@ -408,6 +408,13 @@ bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFra
}
}
UpdateCursorCapture(shouldCaptureCursor);
return shouldConsumeEvent;
}
void LegacyViewportCameraControllerInstance::UpdateCursorCapture(bool shouldCaptureCursor)
{
if (m_capturingCursor != shouldCaptureCursor)
{
if (shouldCaptureCursor)
@@ -427,8 +434,14 @@ bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFra
m_capturingCursor = shouldCaptureCursor;
}
}
return shouldConsumeEvent;
void LegacyViewportCameraControllerInstance::ResetInputChannels()
{
m_modifiers = 0;
m_pressedKeys.clear();
UpdateCursorCapture(false);
m_inRotateMode = m_inMoveMode = m_inOrbitMode = m_inZoomMode = false;
}
void LegacyViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event)