aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus/input.cpp')
-rw-r--r--engines/pegasus/input.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index f4834037d9..36a84dbd3c 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:
@@ -215,10 +223,18 @@ bool InputDeviceManager::notifyEvent(const Common::Event &event) {
}
void InputDeviceManager::pumpEvents() {
+ PegasusEngine *vm = ((PegasusEngine *)g_engine);
+
+ bool saveAllowed = vm->swapSaveAllowed(false);
+ bool openAllowed = vm->swapLoadAllowed(false);
+
// Just poll for events. notifyEvent() will pick up on them.
Common::Event event;
while (g_system->getEventManager()->pollEvent(event))
;
+
+ vm->swapSaveAllowed(saveAllowed);
+ vm->swapLoadAllowed(openAllowed);
}
int operator==(const Input &arg1, const Input &arg2) {