X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fkeyboard.h;h=30ec39c139b74d0b8f32a98cedf5dd765510c406;hb=479298192e3e5b71a402f79520c90372a4c4b504;hp=56aa5c00921390f4cc13f4c74dffa31b03d1f0a8;hpb=c9626e6953c16efc66575eff80c4c0de2f739041;p=libs%2Fgui.git diff --git a/source/input/keyboard.h b/source/input/keyboard.h index 56aa5c0..30ec39c 100644 --- a/source/input/keyboard.h +++ b/source/input/keyboard.h @@ -1,8 +1,10 @@ -#ifndef MSP_GBASE_KEYBOARD_H_ -#define MSP_GBASE_KEYBOARD_H_ +#ifndef MSP_INPUT_KEYBOARD_H_ +#define MSP_INPUT_KEYBOARD_H_ +#include +#include +#include #include "device.h" -#include "../gbase/window.h" namespace Msp { namespace Input { @@ -11,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::accumulated signal_character; + private: - Graphics::EventSource &source; + Graphics::Window &window; public: - Keyboard(Graphics::EventSource &); + Keyboard(Graphics::Window &); + ~Keyboard(); - virtual std::string get_button_name(unsigned) const; + std::string get_button_name(unsigned) const override; private: - void key_press(unsigned, unsigned, unsigned); - void key_release(unsigned, unsigned); + void input_event(const Graphics::Window::Event &); }; } // namespace Input