]> git.tdb.fi Git - libs/gui.git/blob - source/input/keyboard.h
Add decorations for things which should be exported from the library
[libs/gui.git] / source / input / keyboard.h
1 #ifndef MSP_INPUT_KEYBOARD_H_
2 #define MSP_INPUT_KEYBOARD_H_
3
4 #include <sigc++/trackable.h>
5 #include <msp/graphics/mspgui_api.h>
6 #include <msp/graphics/window.h>
7 #include <msp/stringcodec/ustring.h>
8 #include "device.h"
9
10 namespace Msp {
11 namespace Input {
12
13 /**
14 Adapts key events from a window to the abstracted input framework.  Key codes
15 are translated to platform-independent values.  See keys.h for a list.
16 */
17 class MSPGUI_API Keyboard: public Device, public sigc::trackable
18 {
19 public:
20         sigc::signal<bool, StringCodec::unichar>::accumulated<EventAccumulator> signal_character;
21
22 private:
23         Graphics::Window &window;
24
25 public:
26         Keyboard(Graphics::Window &);
27         ~Keyboard();
28
29         std::string get_button_name(unsigned) const override;
30 private:
31         void input_event(const Graphics::Window::Event &);
32 };
33
34 } // namespace Input
35 } // namespace Msp
36
37 #endif