diff --git a/src/app/GUI/mainwindow.cpp b/src/app/GUI/mainwindow.cpp index c39a177e7..a817f518b 100755 --- a/src/app/GUI/mainwindow.cpp +++ b/src/app/GUI/mainwindow.cpp @@ -1282,6 +1282,7 @@ void MainWindow::openTimelineWindow() tr("Timeline"), QString("TimelineWindow"), true, + true, true); } mTimelineWindow->focusWindow(); @@ -1994,7 +1995,7 @@ void MainWindow::closeEvent(QCloseEvent *e) bool MainWindow::processKeyEvent(QKeyEvent *event) { - if (isActiveWindow()) { + if (isActiveWindow() || (mTimelineWindow && mTimelineWindow->isActiveWindow())) { bool returnBool = false; if (event->type() == QEvent::KeyPress && mTimeline->processKeyPress(event)) diff --git a/src/app/GUI/window.cpp b/src/app/GUI/window.cpp index 654f56465..f40bd666c 100644 --- a/src/app/GUI/window.cpp +++ b/src/app/GUI/window.cpp @@ -28,14 +28,18 @@ #include #include +#include "mainwindow.h" + Window::Window(QWidget *parent, QWidget *child, const QString title, const QString id, bool visible, - bool blockEscKey) + bool blockEscKey, + bool forwardKeys) : QDialog(parent) , mBlockEscKey(blockEscKey) + , mForwardKeys(forwardKeys) { setWindowFlags(Qt::Window | Qt::WindowTitleHint | @@ -67,6 +71,9 @@ void Window::focusWindow() void Window::keyPressEvent(QKeyEvent *event) { + if (mForwardKeys) { + MainWindow::sGetInstance()->processKeyEvent(event); + } if (mBlockEscKey && event->key() == Qt::Key_Escape) { return; } QDialog::keyPressEvent(event); } diff --git a/src/app/GUI/window.h b/src/app/GUI/window.h index 2b12d926a..2a2df3af0 100644 --- a/src/app/GUI/window.h +++ b/src/app/GUI/window.h @@ -37,7 +37,8 @@ class Window : public QDialog const QString title, const QString id, bool visible = true, - bool blockEscKey = true); + bool blockEscKey = true, + bool forwardKeys = false); ~Window(); void focusWindow(); @@ -48,6 +49,7 @@ class Window : public QDialog void loadState(bool visible = true); void saveState(); bool mBlockEscKey; + bool mForwardKeys; }; #endif // WINDOW_H