Skip to content

Commit

Permalink
Close keybind settings menu with esc
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Jun 30, 2015
1 parent 29b0dc8 commit 842579e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/guiKeyChangeMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ bool GUIKeyChangeMenu::resetMenu()
bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
{
if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0
&& event.KeyInput.PressedDown)
{
&& event.KeyInput.PressedDown) {

bool prefer_character = shift_down;
KeyPress kp(event.KeyInput, prefer_character);
Expand Down Expand Up @@ -328,9 +327,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
return true;
}
}
}
if (event.EventType == EET_GUI_EVENT)
{
} else if (event.EventType == EET_KEY_INPUT_EVENT && activeKey < 0
&& event.KeyInput.PressedDown
&& event.KeyInput.Key == irr::KEY_ESCAPE) {
quitMenu();
return true;
} else if (event.EventType == EET_GUI_EVENT) {
if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST
&& isVisible())
{
Expand Down

0 comments on commit 842579e

Please sign in to comment.