diff options
author | est31 <MTest31@outlook.com> | 2015-06-30 21:04:06 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-30 21:04:06 +0200 |
commit | 842579eb8c31e6a5d4fb3a56413380b11b7252b7 (patch) | |
tree | cb4ba7ff71ce22a68696ca2bc9acca7349ebc6f2 | |
parent | 29b0dc89e6789bce8663b74feeb32f1961a784d7 (diff) | |
download | minetest-842579eb8c31e6a5d4fb3a56413380b11b7252b7.tar.gz minetest-842579eb8c31e6a5d4fb3a56413380b11b7252b7.tar.bz2 minetest-842579eb8c31e6a5d4fb3a56413380b11b7252b7.zip |
Close keybind settings menu with esc
-rw-r--r-- | src/guiKeyChangeMenu.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 008ac8c5d..261592394 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -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); @@ -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()) { |