diff options
author | Stephen Kennedy | 2008-07-07 14:30:11 +0000 |
---|---|---|
committer | Stephen Kennedy | 2008-07-07 14:30:11 +0000 |
commit | 98f999f8e01c4752a771f1a8c6aec77b6efe3fb5 (patch) | |
tree | b56a61b845e25225491aea6a82180ae5903c32e4 /backends | |
parent | 950b68be7b0e228addf92150abf0fbca1091e57e (diff) | |
download | scummvm-rg350-98f999f8e01c4752a771f1a8c6aec77b6efe3fb5.tar.gz scummvm-rg350-98f999f8e01c4752a771f1a8c6aec77b6efe3fb5.tar.bz2 scummvm-rg350-98f999f8e01c4752a771f1a8c6aec77b6efe3fb5.zip |
WIP: VirtualKeyboard updates:
- got keyboard bitmap displaying (no transparency as yet)
- simple event loop for VK to capture mouse clicks done (and untested code to process the clicks)
- pollEvent() method to deliver the virtual key press events to EventManager
svn-id: r32939
Diffstat (limited to 'backends')
-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; |