KeyboardManager: a class to manage the polling of a switch-matrix keyboard
Diff: KeyboardStateChangeMonitor.cpp
- Revision:
- 2:eb4cc53ff33d
- Child:
- 3:1310c57aca77
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KeyboardStateChangeMonitor.cpp Sun Jan 23 23:15:36 2011 +0000 @@ -0,0 +1,15 @@ +#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