DS: Remove redundant event observer

This commit is contained in:
Cameron Cawley 2021-09-30 17:22:19 +01:00
parent 8c01baaaff
commit e3b72b6fef
2 changed files with 1 additions and 16 deletions

View File

@ -32,11 +32,9 @@ Keyboard::Keyboard(Common::EventDispatcher *eventDispatcher) :
_lastKey(NOKEY),
_visible(false) {
_eventDispatcher->registerSource(this, false);
_eventDispatcher->registerObserver(this, 10, false);
}
Keyboard::~Keyboard() {
_eventDispatcher->unregisterObserver(this);
_eventDispatcher->unregisterSource(this);
}
@ -133,15 +131,4 @@ bool Keyboard::pollEvent(Common::Event &event) {
return true;
}
bool Keyboard::notifyEvent(const Common::Event &event) {
if (event.type == Common::EVENT_VIRTUAL_KEYBOARD) {
if (g_system->getFeatureState(OSystem::kFeatureVirtualKeyboard))
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
else
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
return true;
}
return false;
}
} // End of namespace DS

View File

@ -27,7 +27,7 @@
namespace DS {
class Keyboard : public Common::EventSource, public Common::EventObserver {
class Keyboard : public Common::EventSource {
public:
Keyboard(Common::EventDispatcher *eventDispatcher);
~Keyboard();
@ -41,8 +41,6 @@ public:
// Implementation of the EventSource interface
virtual bool pollEvent(Common::Event &event);
virtual bool notifyEvent(const Common::Event &event) override;
protected:
Common::EventDispatcher *_eventDispatcher;
int _lastKey;