KeyboardManager: a class to manage the polling of a switch-matrix keyboard
kbd_mgr/KeyboardStateChangeMonitor.h@3:1310c57aca77, 2011-02-03 (annotated)
- Committer:
- osmeest
- Date:
- Thu Feb 03 22:01:57 2011 +0000
- Revision:
- 3:1310c57aca77
- Parent:
- 2:eb4cc53ff33d
improve code structure, add key mapping and long key press handling
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
osmeest | 3:1310c57aca77 | 1 | #ifndef KEYBOARD_STATE_CHANGE_MONITOR_H_ |
osmeest | 3:1310c57aca77 | 2 | #define KEYBOARD_STATE_CHANGE_MONITOR_H_ |
osmeest | 3:1310c57aca77 | 3 | |
osmeest | 3:1310c57aca77 | 4 | #include "kbd_mgr/KeyboardStateEventServer.h" |
osmeest | 3:1310c57aca77 | 5 | #include "kbd_mgr/KeyboardState.h" |
osmeest | 3:1310c57aca77 | 6 | |
osmeest | 3:1310c57aca77 | 7 | namespace kbd_mgr { |
osmeest | 3:1310c57aca77 | 8 | |
osmeest | 3:1310c57aca77 | 9 | /** |
osmeest | 3:1310c57aca77 | 10 | * @brief A keyboard state handler that reports only state changes. |
osmeest | 3:1310c57aca77 | 11 | */ |
osmeest | 3:1310c57aca77 | 12 | class KeyboardStateChangeMonitor : public KeyboardStateEventServer, public KeyboardStateHandler { |
osmeest | 3:1310c57aca77 | 13 | public: |
osmeest | 3:1310c57aca77 | 14 | virtual void handleState(const KeyboardState &newState); |
osmeest | 3:1310c57aca77 | 15 | |
osmeest | 3:1310c57aca77 | 16 | private: |
osmeest | 3:1310c57aca77 | 17 | KeyboardState lastState; |
osmeest | 3:1310c57aca77 | 18 | }; |
osmeest | 3:1310c57aca77 | 19 | |
osmeest | 3:1310c57aca77 | 20 | } // kbd_mgr |
osmeest | 3:1310c57aca77 | 21 | |
osmeest | 3:1310c57aca77 | 22 | #endif // KEYBOARD_STATE_CHANGE_MONITOR_H_ |