diff options
author | Bastien Bouclet | 2017-08-29 21:07:23 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-09-12 20:25:24 +0200 |
commit | 731028460fe37f534118ba1d30380460f1f9de80 (patch) | |
tree | 7ff29c853d575d77d44d4a5398548c2ec41fdad9 /engines/pegasus | |
parent | 64967c6222dd4a3eb0589ba970ff27c57f3461bb (diff) | |
download | scummvm-rg350-731028460fe37f534118ba1d30380460f1f9de80.tar.gz scummvm-rg350-731028460fe37f534118ba1d30380460f1f9de80.tar.bz2 scummvm-rg350-731028460fe37f534118ba1d30380460f1f9de80.zip |
PEGASUS: Ignore events occuring while the GUI is visible
Otherwise, pressing escape to close the GMM opens the game's own menu.
Diffstat (limited to 'engines/pegasus')
-rw-r--r-- | engines/pegasus/input.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp index f4834037d9..47ec44a736 100644 --- a/engines/pegasus/input.cpp +++ b/engines/pegasus/input.cpp @@ -26,6 +26,8 @@ #include "common/events.h" #include "common/system.h" +#include "gui/gui-manager.h" + #include "pegasus/cursor.h" #include "pegasus/input.h" #include "pegasus/pegasus.h" @@ -148,6 +150,7 @@ void InputDeviceManager::getInput(Input &input, const InputBits filter) { // Set the console to be requested or not input.setConsoleRequested(_consoleRequested); + _consoleRequested = false; // WORKAROUND: The original had this in currentBits, but then // pressing alt would count as an event (and mess up someone @@ -173,9 +176,14 @@ void InputDeviceManager::waitInput(const InputBits filter) { } bool InputDeviceManager::notifyEvent(const Common::Event &event) { + if (GUI::GuiManager::instance().isActive()) { + // For some reason, the engine hooks in the event system using an EventObserver. + // So we need to explicitly ignore events that happen while ScummVM's GUI is open. + return false; + } + // We're mapping from ScummVM events to pegasus events, which // are based on pippin events. - _consoleRequested = false; switch (event.type) { case Common::EVENT_KEYDOWN: |