]> git.tdb.fi Git - libs/gui.git/blob - source/input/keyboard.h
8cd83f221c3cba317588ec35c4bf216cdb732cf9
[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 <msp/stringcodec/ustring.h>
6 #include "device.h"
7
8 namespace Msp {
9 namespace Input {
10
11 /**
12 Adapts key events from a window to the abstracted input framework.  Key codes
13 are translated to platform-independent values.  See keys.h for a list.
14 */
15 class Keyboard: public Device
16 {
17 public:
18         sigc::signal<bool, StringCodec::unichar>::accumulated<EventAccumulator> signal_character;
19
20 private:
21         Graphics::Window &window;
22
23 public:
24         Keyboard(Graphics::Window &);
25         virtual ~Keyboard();
26
27         virtual std::string get_button_name(unsigned) const;
28 private:
29         void input_event(const Graphics::Window::Event &);
30 };
31
32 } // namespace Input
33 } // namespace Msp
34
35 #endif