1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 14:55:13 -05:00

Close keybind settings menu with esc

This commit is contained in:
est31 2015-06-30 21:04:06 +02:00
parent 29b0dc89e6
commit 842579eb8c

View File

@ -269,8 +269,7 @@ bool GUIKeyChangeMenu::resetMenu()
bool GUIKeyChangeMenu::OnEvent(const SEvent& event) bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
{ {
if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0 if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0
&& event.KeyInput.PressedDown) && event.KeyInput.PressedDown) {
{
bool prefer_character = shift_down; bool prefer_character = shift_down;
KeyPress kp(event.KeyInput, prefer_character); KeyPress kp(event.KeyInput, prefer_character);
@ -328,9 +327,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
return true; return true;
} }
} }
} } else if (event.EventType == EET_KEY_INPUT_EVENT && activeKey < 0
if (event.EventType == EET_GUI_EVENT) && 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 if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST
&& isVisible()) && isVisible())
{ {