From 2deaa7f542ce262727df80360c37932db0a8fd04 Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Wed, 11 Jan 2017 11:05:06 +0100 Subject: [PATCH] Added collectionInputClear parameter to the global settings.conf. If set to true, the input queue will be cleared on entering/exiting a collection. --- RetroFE/Source/RetroFE.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 14da163..a39c460 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -495,9 +495,18 @@ void RetroFE::run() case RETROFE_NEXT_PAGE_MENU_ENTER: if(currentPage_->isIdle()) { - state = RETROFE_IDLE; + bool collectionInputClear = false; + config_.getProperty( "collectionInputClear", collectionInputClear ); + if( collectionInputClear ) + { + // Empty event queue + SDL_Event e; + while (SDL_PollEvent(&e)); + input_.resetStates(); + } + state = RETROFE_IDLE; } - break; + break; case RETROFE_LAUNCH_REQUEST: nextPageItem_ = currentPage_->getSelectedItem(); @@ -572,6 +581,15 @@ void RetroFE::run() if(currentPage_->isIdle()) { currentPage_->cleanup(); + bool collectionInputClear = false; + config_.getProperty( "collectionInputClear", collectionInputClear ); + if( collectionInputClear ) + { + // Empty event queue + SDL_Event e; + while (SDL_PollEvent(&e)); + input_.resetStates(); + } state = RETROFE_IDLE; } break;