diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp index 52fbd92e..dfb07944 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "OpenRGBFont.h" #ifdef __APPLE__ @@ -665,6 +666,26 @@ void OpenRGBDialog2::closeEvent(QCloseEvent *event) } } +void OpenRGBDialog2::keyPressEvent(QKeyEvent *event) +{ + if(event->key() == Qt::Key_F11) + { + if(isFullScreen()) + { + showNormal(); + } + else + { + showFullScreen(); + } + event->accept(); + } + else + { + QMainWindow::keyPressEvent(event); + } +} + bool OpenRGBDialog2::SelectConfigProfile(const std::string name) { /*-----------------------------------------------------*\ diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.h b/qt/OpenRGBDialog2/OpenRGBDialog2.h index bfba91d3..761dd046 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.h @@ -84,6 +84,9 @@ public slots: void SetTrayIcon(bool tray_icon); void handleAboutToQuit(); +protected: + void keyPressEvent(QKeyEvent *event) override; + private: const char* context = "Ui::OpenRGBDialog2";