Merge pull request #14267 from humbletim/fb17479-fix-handshake-keyrelease

FB17479 - Fix scripted key release events for handshakes.
This commit is contained in:
Jamil Akram 2018-11-15 09:21:32 -08:00 committed by GitHub
commit 60b58977cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -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;
}

View file

@ -550,6 +550,7 @@ private:
void keyReleaseEvent(QKeyEvent* event);
void focusOutEvent(QFocusEvent* event);
void synthesizeKeyReleasEvents();
void focusInEvent(QFocusEvent* event);
void mouseMoveEvent(QMouseEvent* event);