]> git.tdb.fi Git - libs/gui.git/blob - source/input/keyboard.h
Add platform independent constants for keys (win32 code untested)
[libs/gui.git] / source / input / keyboard.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GBASE_KEYBOARD_H_
9 #define MSP_GBASE_KEYBOARD_H_
10
11 #include "device.h"
12 #include "../gbase/window.h"
13
14 namespace Msp {
15 namespace Input {
16
17 /**
18 Adapts key events from a window to the abstracted input framework.  Key codes
19 are translated to platform-independent values.  See keys.h for a list.
20 */
21 class Keyboard: public Device
22 {
23 private:
24         Graphics::Window &window;
25
26 public:
27         Keyboard(Graphics::Window &);
28
29         virtual std::string get_button_name(unsigned) const;
30 private:
31         void key_press(unsigned, unsigned, unsigned);
32         void key_release(unsigned, unsigned);
33 };
34
35 } // namespace Input
36 } // namespace Msp
37
38 #endif