KeyboardManager: a class to manage the polling of a switch-matrix keyboard
kbd_mgr/KeyboardStateHandler.h@2:eb4cc53ff33d, 2011-01-23 (annotated)
- Committer:
- osmeest
- Date:
- Sun Jan 23 23:15:36 2011 +0000
- Revision:
- 2:eb4cc53ff33d
- Child:
- 3:1310c57aca77
Thorough split of the code to have one responsibility per class. Generalisation of the keyboard layout (not limited to 4x4 anymore). Introduction of the kbd_mgr namespace (also apparent in header filenames).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
osmeest | 2:eb4cc53ff33d | 1 | #ifndef KEYBOARD_STATE_HANDLER_H_ |
osmeest | 2:eb4cc53ff33d | 2 | #define KEYBOARD_STATE_HANDLER_H_ |
osmeest | 2:eb4cc53ff33d | 3 | |
osmeest | 2:eb4cc53ff33d | 4 | #include "kbd_mgr/KeyboardState.h" |
osmeest | 2:eb4cc53ff33d | 5 | |
osmeest | 2:eb4cc53ff33d | 6 | namespace kbd_mgr { |
osmeest | 2:eb4cc53ff33d | 7 | |
osmeest | 2:eb4cc53ff33d | 8 | /** |
osmeest | 2:eb4cc53ff33d | 9 | * @brief Interface used to report a keyboard state. |
osmeest | 2:eb4cc53ff33d | 10 | */ |
osmeest | 2:eb4cc53ff33d | 11 | class KeyboardStateHandler { |
osmeest | 2:eb4cc53ff33d | 12 | public: |
osmeest | 2:eb4cc53ff33d | 13 | virtual void operator()(const KeyboardState &newState) = 0; |
osmeest | 2:eb4cc53ff33d | 14 | virtual ~KeyboardStateHandler() { } |
osmeest | 2:eb4cc53ff33d | 15 | }; |
osmeest | 2:eb4cc53ff33d | 16 | |
osmeest | 2:eb4cc53ff33d | 17 | } // kbd_mgr |
osmeest | 2:eb4cc53ff33d | 18 | |
osmeest | 2:eb4cc53ff33d | 19 | #endif // KEYBOARD_STATE_HANDLER_H_ |