]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/keyboard.h
Inherit input devices using Window::signal_input_event from sigc::trackable
[libs/gui.git] / source / input / keyboard.h
index 944cf4dfef7657fe9536a3a21cb7767f04a01b0d..15fe4f95cd814f7ef6c7034659c265f29ede18d9 100644 (file)
@@ -1,15 +1,10 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#ifndef MSP_GBASE_KEYBOARD_H_
-#define MSP_GBASE_KEYBOARD_H_
+#ifndef MSP_INPUT_KEYBOARD_H_
+#define MSP_INPUT_KEYBOARD_H_
 
+#include <sigc++/trackable.h>
+#include <msp/graphics/window.h>
+#include <msp/stringcodec/ustring.h>
 #include "device.h"
-#include "../gbase/window.h"
 
 namespace Msp {
 namespace Input {
@@ -18,18 +13,21 @@ namespace Input {
 Adapts key events from a window to the abstracted input framework.  Key codes
 are translated to platform-independent values.  See keys.h for a list.
 */
-class Keyboard: public Device
+class Keyboard: public Device, public sigc::trackable
 {
+public:
+       sigc::signal<bool, StringCodec::unichar>::accumulated<EventAccumulator> signal_character;
+
 private:
-       Graphics::EventSource &source;
+       Graphics::Window &window;
 
 public:
-       Keyboard(Graphics::EventSource &);
+       Keyboard(Graphics::Window &);
+       virtual ~Keyboard();
 
        virtual std::string get_button_name(unsigned) const;
 private:
-       void key_press(unsigned, unsigned, unsigned);
-       void key_release(unsigned, unsigned);
+       void input_event(const Graphics::Window::Event &);
 };
 
 } // namespace Input