diff --git a/projects/frontend/es-app/src/views/GameClipView.cpp b/projects/frontend/es-app/src/views/GameClipView.cpp index 5beef02bcc305df6e3ec355cb54bc32e8ff1638e..3b3b0d08a76e8c12e33eb1112f9aae1b515b1107 100644 --- a/projects/frontend/es-app/src/views/GameClipView.cpp +++ b/projects/frontend/es-app/src/views/GameClipView.cpp @@ -217,7 +217,7 @@ bool GameClipView::ProcessInput(const InputCompactEvent& event) } // TOGGLE FAVORITES - Y - if (event.YPressed()) + if (event.YPressed() && RecalboxConf::Instance().AsString("emulationstation.menu") != "none") { if (mGame->IsGame() && mGame->System().HasFavoritesInTheme()) { diff --git a/projects/frontend/es-app/src/views/SystemView.cpp b/projects/frontend/es-app/src/views/SystemView.cpp index 2fcf2d4790147376db0cfbddc63b3849161ae6f0..cd7f9210eafa07abb13a9e30e5c84d3d517546c5 100755 --- a/projects/frontend/es-app/src/views/SystemView.cpp +++ b/projects/frontend/es-app/src/views/SystemView.cpp @@ -217,6 +217,14 @@ void SystemView::goToSystem(SystemData* system, bool animate) bool SystemView::ProcessInput(const InputCompactEvent& event) { + if (event.IsNotPressedAndReleased()) + return true; + + if (event.HotkeyPressed() && !mHotKeyAlreadyPressed) mHotKeyAlreadyPressed = true; + + else mHotKeyAlreadyPressed = false; + + if (event.AnythingPressed()) { switch (mCarousel.type) @@ -466,6 +474,22 @@ void SystemView::onCursorChanged(const CursorState& state) void SystemView::Render(const Transform4x4f& parentTrans) { + if (mHotKeyAlreadyPressed && mWindow.GetTimeSinceLastInput() >= 5000) + { + if(RecalboxConf::Instance().AsString("emulationstation.menu") != "none") + mWindow.pushGui((new GuiMsgBox(mWindow, "VERROUILLER LES MENUS ?\n(Pour déverrouiller maintenez HOTKEY pendant 10sec.)", _("OK"), [this] + { + RecalboxConf::Instance().SetString("emulationstation.menu", "none"); + }, _("CANCEL"), nullptr))->SetDefaultButton(1)); + else + mWindow.pushGui(new GuiMsgBox(mWindow, _("Déverrouller les menus ?"), _("OK"), [this] + { + RecalboxConf::Instance().SetString("emulationstation.menu", ""); + }, _("CANCEL"), nullptr)); + + mHotKeyAlreadyPressed = false; + } + if(size() == 0) return; // nothing to render @@ -504,13 +528,14 @@ bool SystemView::getHelpPrompts(Help& help) else if (RecalboxConf::Instance().GetNetplayEnabled()) help.Set(HelpType::X, _("NETPLAY")); - help.Set(HelpType::Select, _("QUIT")) - .Set(HelpType::Start, _("MENU")) - .Set(HelpType::R, _("SEARCH")); - - if(GameClipView::IsGameClipEnabled()) + if(RecalboxConf::Instance().AsString("emulationstation.menu") != "none") { - help.Set(HelpType::Y, _("gameclip")); + help.Set(HelpType::Select, _("QUIT")).Set(HelpType::Start, _("MENU")).Set(HelpType::R, _("SEARCH")); + + if (GameClipView::IsGameClipEnabled()) + { + help.Set(HelpType::Y, _("gameclip")); + } } return true; diff --git a/projects/frontend/es-app/src/views/SystemView.h b/projects/frontend/es-app/src/views/SystemView.h index a7f0d72cd1798650b1cab915c2cb52a068bc589f..4ce9f5567f6a9495c5443da4643f327abad29f8d 100755 --- a/projects/frontend/es-app/src/views/SystemView.h +++ b/projects/frontend/es-app/src/views/SystemView.h @@ -112,4 +112,5 @@ private: bool mViewNeedsReload; bool mShowing; bool launchKodi; + bool mHotKeyAlreadyPressed = false; }; diff --git a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp index 529dea3fccf145513ee0a119ae32265ffdb53819..a4b754c624fb562b8a62f5ff101ee8583c9018e6 100755 --- a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -183,7 +183,7 @@ bool ISimpleGameListView::ProcessInput(const InputCompactEvent& event) } // TOGGLE FAVORITES - if (event.YPressed() && !cursor->TopAncestor().PreInstalled()) + if (RecalboxConf::Instance().AsString("emulationstation.menu") != "none" && event.YPressed() && !cursor->TopAncestor().PreInstalled()) { if (cursor->IsGame() && cursor->System().HasFavoritesInTheme()) @@ -300,7 +300,7 @@ bool ISimpleGameListView::ProcessInput(const InputCompactEvent& event) return true; } - if (event.StartPressed()) + if (event.StartPressed() && RecalboxConf::Instance().AsString("emulationstation.menu") != "none") { clean(); mWindow.pushGui(new GuiMenuGamelistOptions(mWindow, mSystem, mSystemManager)); @@ -329,8 +329,6 @@ bool ISimpleGameListView::getHelpPrompts(Help& help) help.Set(HelpType::X, _("P2K CONTROLS")); } FileData* fd = getCursor(); - if (!fd->TopAncestor().PreInstalled()) - help.Set(HelpType::Y, IsFavoriteSystem() ? _("Remove from favorite") : _("Favorite")); if (!hideSystemView) help.Set(Help::Cancel(), _("BACK")); @@ -340,7 +338,12 @@ bool ISimpleGameListView::getHelpPrompts(Help& help) if (RecalboxConf::Instance().GetQuickSystemSelect() && !hideSystemView) help.Set(HelpType::LeftRight, _("SYSTEM")); - help.Set(HelpType::Start, _("OPTIONS")); + if(RecalboxConf::Instance().AsString("emulationstation.menu") != "none") + { + help.Set(HelpType::Start, _("OPTIONS")); + if (!fd->TopAncestor().PreInstalled()) + help.Set(HelpType::Y, IsFavoriteSystem() ? _("Remove from favorite") : _("Favorite")); + } return true; } diff --git a/projects/frontend/es-core/src/WindowManager.cpp b/projects/frontend/es-core/src/WindowManager.cpp index 5c97bb2f71dbff8017daae561c8b17240b9eb65b..53856bb6931310237a8ae79ae4e83b997b44560e 100644 --- a/projects/frontend/es-core/src/WindowManager.cpp +++ b/projects/frontend/es-core/src/WindowManager.cpp @@ -176,7 +176,9 @@ bool WindowManager::ProcessInput(const InputCompactEvent& event) return true; } - mTimeSinceLastInput = 0; + if(!event.IsNotPressedAndReleased()) + mTimeSinceLastInput = 0; + if (peekGui() != nullptr) { peekGui()->ProcessInput(event); diff --git a/projects/frontend/es-core/src/WindowManager.h b/projects/frontend/es-core/src/WindowManager.h index d16430e2130d058f49004c701a5963cf690dba5c..503cac139aae55d28f1aa7835b4b4002a1380a5a 100644 --- a/projects/frontend/es-core/src/WindowManager.h +++ b/projects/frontend/es-core/src/WindowManager.h @@ -61,6 +61,8 @@ class WindowManager void DoWake(); + unsigned int GetTimeSinceLastInput() const { return mTimeSinceLastInput; } + /*! * @brief Add new popup to dysplay list * @param infoPopup Popup to add to display list diff --git a/projects/frontend/es-core/src/input/InputCompactEvent.h b/projects/frontend/es-core/src/input/InputCompactEvent.h index 4217d8834b8370db12afa55194e1664e3665e4f0..47833e7e8c4d4d484a317c6c575a6aa9d9dd2447 100644 --- a/projects/frontend/es-core/src/input/InputCompactEvent.h +++ b/projects/frontend/es-core/src/input/InputCompactEvent.h @@ -217,6 +217,8 @@ class InputCompactEvent bool CancelPressed() const { return RecalboxConf::Instance().GetSwapValidateAndCancel() ? BPressed() : APressed(); } bool CancelReleased() const { return RecalboxConf::Instance().GetSwapValidateAndCancel() ? BReleased() : AReleased(); } + bool IsNotPressedAndReleased() const { return !mActivatedEntryFlags && !mDeactivatedEntryFlags; } + /* * Debug */