diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5256ef2c6a..969a05a792 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4159,6 +4159,10 @@ void Application::focusOutEvent(QFocusEvent* event) { SpacemouseManager::getInstance().ManagerFocusOutEvent(); #endif + synthesizeKeyReleasEvents(); +} + +void Application::synthesizeKeyReleasEvents() { // synthesize events for keys currently pressed, since we may not get their release events // Because our key event handlers may manipulate _keysPressed, lets swap the keys pressed into a local copy, // clearing the existing list. @@ -4784,6 +4788,7 @@ void Application::idle() { if (_keyboardDeviceHasFocus && activeFocusItem != offscreenUi->getRootItem()) { _keyboardMouseDevice->pluginFocusOutEvent(); _keyboardDeviceHasFocus = false; + synthesizeKeyReleasEvents(); } else if (activeFocusItem == offscreenUi->getRootItem()) { _keyboardDeviceHasFocus = true; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 6275feaf29..9b8aac425a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -550,6 +550,7 @@ private: void keyReleaseEvent(QKeyEvent* event); void focusOutEvent(QFocusEvent* event); + void synthesizeKeyReleasEvents(); void focusInEvent(QFocusEvent* event); void mouseMoveEvent(QMouseEvent* event);