aboutsummaryrefslogtreecommitdiff
path: root/backends/events/default
diff options
context:
space:
mode:
authorStephen Kennedy2008-08-18 10:07:11 +0000
committerStephen Kennedy2008-08-18 10:07:11 +0000
commitd92909203b56d9b3fa6c4989bdeb83dbed5b94d5 (patch)
tree350de91c678c790dde49487804b02e1bb317f1d2 /backends/events/default
parent63c4a61032bd97b478de9cbf82510f461d08f653 (diff)
downloadscummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.tar.gz
scummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.tar.bz2
scummvm-rg350-d92909203b56d9b3fa6c4989bdeb83dbed5b94d5.zip
- proper init of virtual keyboard now implemented (involved added EventManager::init() which is called after screen has been initialised)
- changed HardwareKey / Action id field to an array of 4 chars instead of int32. Means that the keymap key/value pairs in config file are more readable. svn-id: r33986
Diffstat (limited to 'backends/events/default')
-rw-r--r--backends/events/default/default-events.cpp27
-rw-r--r--backends/events/default/default-events.h1
2 files changed, 16 insertions, 12 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index 282d8251b5..d6b9978d94 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -199,6 +199,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
_vk = new Common::VirtualKeyboard();
_keymapper = new Common::Keymapper(this);
_remap = false;
+
+ //init();
}
DefaultEventManager::~DefaultEventManager() {
@@ -259,6 +261,14 @@ DefaultEventManager::~DefaultEventManager() {
_boss->deleteMutex(_recorderMutex);
}
+void DefaultEventManager::init() {
+ if (ConfMan.hasKey("vkeybd_pack_name")) {
+ _vk->loadKeyboardPack(ConfMan.get("vkeybd_pack_name"));
+ } else {
+ _vk->loadKeyboardPack("vkeybd");
+ }
+}
+
bool DefaultEventManager::playback(Common::Event &event) {
if (!_hasPlaybackEvent) {
@@ -418,22 +428,15 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_keyRepeatTime = time + kKeyRepeatInitialDelay;
#endif
- // HACK to show/hide keyboard (keyboard is not shown if gui is active)
if (event.kbd.keycode == Common::KEYCODE_F6 && event.kbd.flags == 0) {
if (_vk->isDisplaying()) {
_vk->close(true);
} else {
- static bool enabled = true;
- if (enabled && _vk->isLoaded() == false) {
- enabled = _vk->loadKeyboardPack("vkeybd");
- }
- if (enabled) {
- bool isPaused = (g_engine) ? g_engine->isPaused() : true;
- if (!isPaused) g_engine->pauseEngine(true);
- _vk->show();
- if (!isPaused) g_engine->pauseEngine(false);
- result = false;
- }
+ bool isPaused = (g_engine) ? g_engine->isPaused() : true;
+ if (!isPaused) g_engine->pauseEngine(true);
+ _vk->show();
+ if (!isPaused) g_engine->pauseEngine(false);
+ result = false;
}
} else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) {
if (!_remap) {
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 81387d8d98..ba30cb2383 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -122,6 +122,7 @@ public:
DefaultEventManager(OSystem *boss);
~DefaultEventManager();
+ virtual void init();
virtual bool pollEvent(Common::Event &event);
virtual void pushEvent(const Common::Event &event);
virtual void registerRandomSource(Common::RandomSource &rnd, const char *name);