diff options
Diffstat (limited to 'backends/events/default')
-rw-r--r-- | backends/events/default/default-events.cpp | 21 | ||||
-rw-r--r-- | backends/events/default/default-events.h | 3 |
2 files changed, 23 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 0caba25792..601e292ad0 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -191,6 +191,9 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) : _hasPlaybackEvent = false; } + + _vk = new GUI::VirtualKeyboard(); + _vk->loadKeyboardPack("test"); } DefaultEventManager::~DefaultEventManager() { @@ -349,7 +352,10 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { uint32 time = _boss->getMillis(); bool result; - result = _boss->pollEvent(event); + // poll virtual keyboard + result = _vk->pollEvent(event); + // if no vk event, then poll backend + if (!result) result = _boss->pollEvent(event); if (_recordMode != kPassthrough) { @@ -384,6 +390,19 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { _currentKeyDown.flags = event.kbd.flags; _keyRepeatTime = time + kKeyRepeatInitialDelay; #endif + + // quick hack to show/hide keyboard + if (event.kbd.keycode == Common::KEYCODE_F6 && event.kbd.flags == 0) { + if (_vk->isDisplaying()) { + _vk->hide(); + } else { + bool isPaused = (g_engine) ? g_engine->isPaused() : true; + if (!isPaused) g_engine->pauseEngine(true); + _vk->show(); + if (!isPaused) g_engine->pauseEngine(false); + } + } + break; case Common::EVENT_KEYUP: _modifierState = event.kbd.flags; diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 98dcd4b3de..db054b4d26 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -28,6 +28,7 @@ #include "common/events.h" #include "common/savefile.h" +#include "gui/virtualKeyboard.h" /* At some point we will remove pollEvent from OSystem and change @@ -44,6 +45,8 @@ use a subclass of EventProvider. class DefaultEventManager : public Common::EventManager { OSystem *_boss; + GUI::VirtualKeyboard *_vk; + Common::Point _mousePos; int _buttonState; int _modifierState; |