]> git.tdb.fi Git - libs/gui.git/blob - source/input/keyboard.h
Consistently label the graphics part as graphics
[libs/gui.git] / source / input / keyboard.h
1 #ifndef MSP_INPUT_KEYBOARD_H_
2 #define MSP_INPUT_KEYBOARD_H_
3
4 #include <msp/graphics/window.h>
5 #include "device.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