fix repeated ESC from debugger

This commit is contained in:
thrust26 2018-01-20 21:22:01 +01:00
parent 7d9b7388c9
commit 1b5ac9d3b5
1 changed files with 13 additions and 10 deletions

View File

@ -618,18 +618,21 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, bool state)
if(!(StellaModTest::isControl(mod) || StellaModTest::isShift(mod) || StellaModTest::isAlt(mod)))
{
// special handling for Escape key
if(state && key == KBDK_ESCAPE)
if(KBDK_ESCAPE)
{
if(myState == EventHandlerState::PAUSE)
if(state)
{
setEventState(EventHandlerState::EMULATION);
return;
}
else if(myState == EventHandlerState::CMDMENU ||
myState == EventHandlerState::TIMEMACHINE)
{
leaveMenuMode();
return;
if(myState == EventHandlerState::PAUSE)
{
setEventState(EventHandlerState::EMULATION);
return;
}
else if(myState == EventHandlerState::CMDMENU ||
myState == EventHandlerState::TIMEMACHINE)
{
leaveMenuMode();
return;
}
}
else if(myState == EventHandlerState::DEBUGGER && myOSystem.debugger().canExit())
{