KeyboardManager: a class to manage the polling of a switch-matrix keyboard
Diff: KeyboardStateChangeMonitor.cpp
- Revision:
- 3:1310c57aca77
- Parent:
- 2:eb4cc53ff33d
--- a/KeyboardStateChangeMonitor.cpp Sun Jan 23 23:15:36 2011 +0000 +++ b/KeyboardStateChangeMonitor.cpp Thu Feb 03 22:01:57 2011 +0000 @@ -1,15 +1,13 @@ -#include "kbd_mgr/KeyboardStateChangeMonitor.h" - -namespace kbd_mgr { - -void KeyboardStateChangeMonitor::operator()(const KeyboardState &newState) -{ - if (newState != this->lastState) { - if (this->handler) { - (*this->handler)(newState); - } - this->lastState = newState; - } -} - -} // kbd_mgr +#include "kbd_mgr/KeyboardStateChangeMonitor.h" + +namespace kbd_mgr { + +void KeyboardStateChangeMonitor::handleState(const KeyboardState &newState) +{ + if (newState != this->lastState) { + invokeHandler(newState); + this->lastState = newState; + } +} + +} // kbd_mgr