KeyboardManager: a class to manage the polling of a switch-matrix keyboard
kbd_mgr/KeyPressEventHandler.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 KEY_PRESS_EVENT_HANDLER_H_ |
osmeest | 2:eb4cc53ff33d | 2 | #define KEY_PRESS_EVENT_HANDLER_H_ |
osmeest | 2:eb4cc53ff33d | 3 | |
osmeest | 2:eb4cc53ff33d | 4 | namespace kbd_mgr { |
osmeest | 2:eb4cc53ff33d | 5 | |
osmeest | 2:eb4cc53ff33d | 6 | /** |
osmeest | 2:eb4cc53ff33d | 7 | * @brief Interface used to report key presses and releases. |
osmeest | 2:eb4cc53ff33d | 8 | */ |
osmeest | 2:eb4cc53ff33d | 9 | class KeyPressEventHandler { |
osmeest | 2:eb4cc53ff33d | 10 | public: |
osmeest | 2:eb4cc53ff33d | 11 | enum { |
osmeest | 2:eb4cc53ff33d | 12 | NoKey = -1 |
osmeest | 2:eb4cc53ff33d | 13 | }; |
osmeest | 2:eb4cc53ff33d | 14 | |
osmeest | 2:eb4cc53ff33d | 15 | virtual void operator()(int key, bool keyDown) = 0; |
osmeest | 2:eb4cc53ff33d | 16 | virtual ~KeyPressEventHandler() { } |
osmeest | 2:eb4cc53ff33d | 17 | }; |
osmeest | 2:eb4cc53ff33d | 18 | |
osmeest | 2:eb4cc53ff33d | 19 | } // kbd_mgr |
osmeest | 2:eb4cc53ff33d | 20 | |
osmeest | 2:eb4cc53ff33d | 21 | #endif // KEY_PRESS_EVENT_HANDLER_H_ |