diff --git a/Code/Editor/LegacyViewportCameraController.cpp b/Code/Editor/LegacyViewportCameraController.cpp index 0750db8d97..f437196548 100644 --- a/Code/Editor/LegacyViewportCameraController.cpp +++ b/Code/Editor/LegacyViewportCameraController.cpp @@ -404,7 +404,7 @@ bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFra } else if (auto key = GetKeyboardKey(event.m_inputChannel); key != Qt::Key_unknown) { - if (state == InputChannel::State::Ended) + if (!event.m_inputChannel.IsActive()) { m_pressedKeys.erase(key); } diff --git a/Code/Editor/ViewportManipulatorController.cpp b/Code/Editor/ViewportManipulatorController.cpp index c7d2885cb2..fb696a61f3 100644 --- a/Code/Editor/ViewportManipulatorController.cpp +++ b/Code/Editor/ViewportManipulatorController.cpp @@ -216,7 +216,8 @@ namespace SandboxEditor interactionHandled, AzToolsFramework::GetEntityContextId(), targetInteractionEvent, mouseInteractionEvent); } - return interactionHandled; + // Only filter button/key press events, not release events + return interactionHandled && event.m_inputChannel.IsActive(); } void ViewportManipulatorControllerInstance::ResetInputChannels() diff --git a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp index 3658f9cd22..a85d631160 100644 --- a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp +++ b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp @@ -747,19 +747,23 @@ namespace AzFramework return button == inputChannelId; }); - if (inputChannelId == InputDeviceMouse::Movement::X) + // Accept active mouse channel updates, inactive movement channels will just have a 0 delta. + if (inputChannel.IsActive()) { - return HorizontalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; - } - else if (inputChannelId == InputDeviceMouse::Movement::Y) - { - return VerticalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; - } - else if (inputChannelId == InputDeviceMouse::Movement::Z) - { - return ScrollEvent{ inputChannel.GetValue() }; + if (inputChannelId == InputDeviceMouse::Movement::X) + { + return HorizontalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; + } + else if (inputChannelId == InputDeviceMouse::Movement::Y) + { + return VerticalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; + } + else if (inputChannelId == InputDeviceMouse::Movement::Z) + { + return ScrollEvent{ inputChannel.GetValue() }; + } } - else if (wasMouseButton || InputDeviceKeyboard::IsKeyboardDevice(inputDeviceId)) + if (wasMouseButton || InputDeviceKeyboard::IsKeyboardDevice(inputDeviceId)) { return DiscreteInputEvent{ inputChannelId, inputChannel.GetState() }; }