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))) if(!(StellaModTest::isControl(mod) || StellaModTest::isShift(mod) || StellaModTest::isAlt(mod)))
{ {
// special handling for Escape key // special handling for Escape key
if(state && key == KBDK_ESCAPE) if(KBDK_ESCAPE)
{ {
if(myState == EventHandlerState::PAUSE) if(state)
{ {
setEventState(EventHandlerState::EMULATION); if(myState == EventHandlerState::PAUSE)
return; {
} setEventState(EventHandlerState::EMULATION);
else if(myState == EventHandlerState::CMDMENU || return;
myState == EventHandlerState::TIMEMACHINE) }
{ else if(myState == EventHandlerState::CMDMENU ||
leaveMenuMode(); myState == EventHandlerState::TIMEMACHINE)
return; {
leaveMenuMode();
return;
}
} }
else if(myState == EventHandlerState::DEBUGGER && myOSystem.debugger().canExit()) else if(myState == EventHandlerState::DEBUGGER && myOSystem.debugger().canExit())
{ {