aboutsummaryrefslogtreecommitdiff
path: root/backends/events
diff options
context:
space:
mode:
authorStephen Kennedy2008-08-13 19:24:52 +0000
committerStephen Kennedy2008-08-13 19:24:52 +0000
commit70dde2d8bdfeb0e86a76d196193339f9ec9e17ab (patch)
treef7fb58f22d08e815b06e8dc7bb6058079a4b2cef /backends/events
parent6b638f0e58d45096ca77cfafec5e59b14e706d1a (diff)
downloadscummvm-rg350-70dde2d8bdfeb0e86a76d196193339f9ec9e17ab.tar.gz
scummvm-rg350-70dde2d8bdfeb0e86a76d196193339f9ec9e17ab.tar.bz2
scummvm-rg350-70dde2d8bdfeb0e86a76d196193339f9ec9e17ab.zip
RemapDialog now properly uses reflowLayout() and open(), so that the same instance can be reopened
svn-id: r33843
Diffstat (limited to 'backends/events')
-rw-r--r--backends/events/default/default-events.cpp12
-rw-r--r--backends/events/default/default-events.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index ccea12dad6..af8f9fa231 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -198,6 +198,7 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
_vk = new Common::VirtualKeyboard();
_keymapper = new Common::Keymapper(this);
+ _remap = false;
}
DefaultEventManager::~DefaultEventManager() {
@@ -429,8 +430,15 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
result = false;
}
} else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) {
- Common::RemapDialog dialog;
- dialog.runModal();
+ if (!_remap) {
+ _remap = true;
+ Common::RemapDialog _remapDialog;
+ bool isPaused = (g_engine) ? g_engine->isPaused() : true;
+ if (!isPaused) g_engine->pauseEngine(true);
+ _remapDialog.runModal();
+ if (!isPaused) g_engine->pauseEngine(false);
+ _remap = false;
+ }
}
break;
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 8e24120ad0..81387d8d98 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -31,6 +31,7 @@
#include "common/savefile.h"
namespace Common {
+ class Keymapper;
class VirtualKeyboard;
}
@@ -51,6 +52,7 @@ class DefaultEventManager : public Common::EventManager {
Common::VirtualKeyboard *_vk;
Common::Keymapper *_keymapper;
+ bool _remap;
Common::Queue<Common::Event> _artificialEventQueue;
int _artificialEventCounter;