aboutsummaryrefslogtreecommitdiff
path: root/backends/events/default/default-events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/events/default/default-events.cpp')
-rw-r--r--backends/events/default/default-events.cpp27
1 files changed, 15 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) {