diff options
author | Stephen Kennedy | 2008-08-06 14:21:05 +0000 |
---|---|---|
committer | Stephen Kennedy | 2008-08-06 14:21:05 +0000 |
commit | 57b13141af10c5e0773c2e1606daca8e08410ed5 (patch) | |
tree | a890e33f430cbff65f99a4512058667e4cfb343e /backends/events/default | |
parent | 1caf48b08435b4077843cb7ebfe14ee45180f8ee (diff) | |
download | scummvm-rg350-57b13141af10c5e0773c2e1606daca8e08410ed5.tar.gz scummvm-rg350-57b13141af10c5e0773c2e1606daca8e08410ed5.tar.bz2 scummvm-rg350-57b13141af10c5e0773c2e1606daca8e08410ed5.zip |
Keymapper WIP:
* Implemented stack-based active map in Keymapper
* Started proper testing by adding code to OSystem_SDL to set up simple HardwareKeySet and Keymap
svn-id: r33660
Diffstat (limited to 'backends/events/default')
-rw-r--r-- | backends/events/default/default-events.cpp | 7 | ||||
-rw-r--r-- | backends/events/default/default-events.h | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index fa9ff38330..9bafdd9e4f 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -196,10 +196,11 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) : } _vk = new Common::VirtualKeyboard(); - _keyMapper = new Common::Keymapper(this); + _keymapper = new Common::Keymapper(this); } DefaultEventManager::~DefaultEventManager() { + delete _keymapper; delete _vk; _boss->lockMutex(_timeMutex); _boss->lockMutex(_recorderMutex); @@ -372,10 +373,10 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { if (result) { // send key press events to keymapper if (event.type == Common::EVENT_KEYDOWN) { - if (_keyMapper->mapKeyDown(event.kbd)) + if (_keymapper->mapKeyDown(event.kbd)) result = false; } else if (event.type == Common::EVENT_KEYUP) { - if (_keyMapper->mapKeyUp(event.kbd)) + if (_keymapper->mapKeyUp(event.kbd)) result = false; } } diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 2dd3ccc6e2..8e24120ad0 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -32,7 +32,6 @@ namespace Common { class VirtualKeyboard; - class Keymapper; } /* @@ -51,7 +50,7 @@ class DefaultEventManager : public Common::EventManager { OSystem *_boss; Common::VirtualKeyboard *_vk; - Common::Keymapper *_keyMapper; + Common::Keymapper *_keymapper; Common::Queue<Common::Event> _artificialEventQueue; int _artificialEventCounter; @@ -130,6 +129,7 @@ public: virtual int getButtonState() const { return _buttonState; } virtual int getModifierState() const { return _modifierState; } virtual int shouldQuit() const { return _shouldQuit; } + virtual Common::Keymapper *getKeymapper() { return _keymapper; } }; #endif |