aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorTarek Soliman2012-01-07 22:17:39 -0600
committerTarek Soliman2012-01-07 22:20:48 -0600
commit12d1a9d37f716d8aae4e373705d7f8beec1b8842 (patch)
tree5022ce4f8879b1ba07fb1dc5b9a80d023034f6ad /engines/kyra
parent37d77253cfd5cc1c7bef635d4d5bd05eb53ac02c (diff)
downloadscummvm-rg350-12d1a9d37f716d8aae4e373705d7f8beec1b8842.tar.gz
scummvm-rg350-12d1a9d37f716d8aae4e373705d7f8beec1b8842.tar.bz2
scummvm-rg350-12d1a9d37f716d8aae4e373705d7f8beec1b8842.zip
KYRA: Fix LoL/EoB savegame typing issue with keymapper
If you bind letters (e.g. WSAD) using the keymapper and then try to save using the in-engine dialog, the letters would get captured and make it impossible to name a save using those letters. Thanks LordHoto
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/gui_eob.cpp10
-rw-r--r--engines/kyra/gui_lol.cpp12
2 files changed, 22 insertions, 0 deletions
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index d60fa47571..611eab1bff 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -29,6 +29,7 @@
#include "kyra/timer.h"
#include "kyra/util.h"
+#include "backends/keymapper/keymapper.h"
#include "common/system.h"
#include "common/savefile.h"
#include "graphics/scaler.h"
@@ -2419,6 +2420,11 @@ void GUI_EoB::updateBoxFrameHighLight(int box) {
}
int GUI_EoB::getTextInput(char *dest, int x, int y, int destMaxLen, int textColor1, int textColor2, int cursorColor) {
+#ifdef ENABLE_KEYMAPPER
+ Common::Keymapper *const keymapper = _vm->getEventManager()->getKeymapper();
+ keymapper->pushKeymap(Common::kGlobalKeymapName);
+#endif
+
uint8 cursorState = 1;
char sufx[] = " ";
@@ -2533,6 +2539,10 @@ int GUI_EoB::getTextInput(char *dest, int x, int y, int destMaxLen, int textColo
} while (_keyPressed.keycode != Common::KEYCODE_RETURN && _keyPressed.keycode != Common::KEYCODE_ESCAPE && !_vm->shouldQuit());
+#ifdef ENABLE_KEYMAPPER
+ keymapper->popKeymap(Common::kGlobalKeymapName);
+#endif
+
return _keyPressed.keycode == Common::KEYCODE_ESCAPE ? -1 : len;
}
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index 80052c70f2..b025aefbd0 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -35,6 +35,8 @@
#include "graphics/scaler.h"
+#include "backends/keymapper/keymapper.h"
+
#include "base/version.h"
namespace Kyra {
@@ -2549,6 +2551,11 @@ int GUI_LoL::getInput() {
if (!_displayMenu)
return 0;
+#ifdef ENABLE_KEYMAPPER
+ Common::Keymapper *const keymapper = _vm->getEventManager()->getKeymapper();
+ keymapper->pushKeymap(Common::kGlobalKeymapName);
+#endif
+
Common::Point p = _vm->getMousePos();
_vm->_mouseX = p.x;
_vm->_mouseY = p.y;
@@ -2585,6 +2592,11 @@ int GUI_LoL::getInput() {
_displayMenu = false;
_vm->delay(8);
+
+#ifdef ENABLE_KEYMAPPER
+ keymapper->popKeymap(Common::kGlobalKeymapName);
+#endif
+
return inputFlag & 0x8000 ? 1 : 0;
}