Skip to content

Commit

Permalink
Fix menu issues when hitting the ESC (cancel) key.
Browse files Browse the repository at this point in the history
Fixes ticket:2697
  • Loading branch information
buginator committed Jun 12, 2011
1 parent 316272b commit 7bf5a23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/frontend.cpp
Expand Up @@ -80,7 +80,12 @@ bool bLimiterLoaded = false;
//
bool CancelPressed(void)
{
return keyPressed(KEY_ESC);
const bool cancel = keyPressed(KEY_ESC);
if (cancel)
{
inputLoseFocus(); // clear the input buffer.
}
return cancel;
}


Expand Down
9 changes: 1 addition & 8 deletions src/multiint.cpp
Expand Up @@ -3467,14 +3467,7 @@ void runMultiOptions(void)

if (CancelPressed())
{
if (multiRequestUp)
{
changeTitleMode(lastTitleMode);
}
else
{
processMultiopWidgets(CON_CANCEL); // "Press" the cancel button to clean up net connections and stuff.
}
processMultiopWidgets(CON_CANCEL); // "Press" the cancel button to clean up net connections and stuff.
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/multimenu.cpp
Expand Up @@ -59,6 +59,7 @@
#include "keybind.h"
#include "loop.h"
#include "lib/framework/frameint.h"
#include "frontend.h"

// ////////////////////////////////////////////////////////////////////////////
// defines
Expand Down Expand Up @@ -664,7 +665,7 @@ static void closeMultiRequester(void)

bool runMultiRequester(UDWORD id,UDWORD *mode, char *chosen,UDWORD *chosenValue)
{
if( id==M_REQUEST_CLOSE) // close
if( (id == M_REQUEST_CLOSE) || CancelPressed() ) // user hit close box || hit the cancel key
{
closeMultiRequester();
return true;
Expand Down

0 comments on commit 7bf5a23

Please sign in to comment.