]> git.tdb.fi Git - libs/gui.git/blob - source/input/keyboard.h
56aa5c00921390f4cc13f4c74dffa31b03d1f0a8
[libs/gui.git] / source / input / keyboard.h
1 #ifndef MSP_GBASE_KEYBOARD_H_
2 #define MSP_GBASE_KEYBOARD_H_
3
4 #include "device.h"
5 #include "../gbase/window.h"
6
7 namespace Msp {
8 namespace Input {
9
10 /**
11 Adapts key events from a window to the abstracted input framework.  Key codes
12 are translated to platform-independent values.  See keys.h for a list.
13 */
14 class Keyboard: public Device
15 {
16 private:
17         Graphics::EventSource &source;
18
19 public:
20         Keyboard(Graphics::EventSource &);
21
22         virtual std::string get_button_name(unsigned) const;
23 private:
24         void key_press(unsigned, unsigned, unsigned);
25         void key_release(unsigned, unsigned);
26 };
27
28 } // namespace Input
29 } // namespace Msp
30
31 #endif