From 233ffbe384ea4e07414c680a950b62bf55bc9c5d Mon Sep 17 00:00:00 2001 From: Vincent Robinson Date: Wed, 23 Apr 2025 12:41:32 -0700 Subject: [PATCH] Change exit keybinding and fix bug in allow_close[] --- README.md | 2 +- src/client/inputhandler.cpp | 2 +- src/gui/guiFormSpecMenu.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d5cdf890..6abd6d22c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Some can be changed in the key config dialog in the settings tab. | T | Chat | | / | Command | | Esc | Pause menu/abort/exit (pauses only singleplayer game) | -| Ctrl + Esc | Exit directly to main menu from anywhere, bypassing pause menu | +| Shift + Esc | Exit directly to main menu from anywhere, bypassing pause menu | | + | Increase view range | | - | Decrease view range | | K | Enable/disable fly mode (needs fly privilege) | diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp index 64c9cc968..d79bee4d6 100644 --- a/src/client/inputhandler.cpp +++ b/src/client/inputhandler.cpp @@ -151,7 +151,7 @@ bool MyEventReceiver::OnEvent(const SEvent &event) fullscreen_is_down = event.KeyInput.PressedDown; return true; } else if (keyCode == EscapeKey && - event.KeyInput.PressedDown && event.KeyInput.Control) { + event.KeyInput.PressedDown && event.KeyInput.Shift) { g_gamecallback->disconnect(); return true; } diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h index 3cfd79cae..8dbfcab93 100644 --- a/src/gui/guiFormSpecMenu.h +++ b/src/gui/guiFormSpecMenu.h @@ -206,7 +206,10 @@ public: void defaultAllowClose(bool value) { + // Also set m_allowclose here in order to have the correct value if + // escape is pressed before regenerateGui() is called. m_default_allowclose = value; + m_allowclose = value; } void setDebugView(bool value)