Skip to content

Commit

Permalink
Controls: fix behaviour when B button is pressed on gamepad, buzz whe…
Browse files Browse the repository at this point in the history
…n ESCAPE is pressed
  • Loading branch information
a1batross committed Jul 9, 2019
1 parent 578a0cb commit 9336c6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions menus/Controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static class CMenuControls : public CMenuFramework
{
public:
bool KeyUp( int key ) override;
bool KeyDown( int key ) override;
} msgBox1; // small msgbox

CMenuYesNoMessageBox msgBox2; // large msgbox
Expand Down Expand Up @@ -300,13 +301,13 @@ bool CMenuControls::CGrabKeyMessageBox::KeyUp( int key )
CMenuControls *parent = ((CMenuControls*)m_pParent);

// defining a key
if( key == '`' || key == '~' )
if( key == '`' || key == '~' || key == K_ESCAPE )
{
Hide();
PlayLocalSound( uiSoundBuzz );
return true;
}
else if( key != K_ESCAPE )
else
{
char cmd[4096];

Expand All @@ -324,6 +325,11 @@ bool CMenuControls::CGrabKeyMessageBox::KeyUp( int key )
return true;
}

bool CMenuControls::CGrabKeyMessageBox::KeyDown( int key )
{
return true;
}

void CMenuControls::UnbindEntry()
{
if( !keysListModel.IsLineUsable( keysList.GetCurrentIndex() ) )
Expand Down

0 comments on commit 9336c6a

Please sign in to comment.