diff options
Diffstat (limited to 'backends/events/default')
-rw-r--r-- | backends/events/default/default-events.cpp | 27 | ||||
-rw-r--r-- | backends/events/default/default-events.h | 1 |
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); |