2
0
Эх сурвалжийг харах

[LYN-4393] As a dev I want to Enable Gems in O3DE.exe with Keyboard (#1760)

Enabling and disabling the selected gem is now possible by pressing the space bar.

Signed-off-by: Benjamin Jillich <[email protected]>
Benjamin Jillich 4 жил өмнө
parent
commit
2a42e7a012

+ 11 - 0
Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp

@@ -131,6 +131,17 @@ namespace O3DE::ProjectManager
             return false;
         }
 
+        if (event->type() == QEvent::KeyPress)
+        {
+            auto keyEvent = static_cast<const QKeyEvent*>(event);
+            if (keyEvent->key() == Qt::Key_Space)
+            {
+                const bool isAdded = GemModel::IsAdded(modelIndex);
+                GemModel::SetIsAdded(*model, modelIndex, !isAdded);
+                return true;
+            }
+        }
+
         if (event->type() == QEvent::MouseButtonPress)
         {
             QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);