From b45ba2f7ceb60c1a6abc1a951a97b40c03671264 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 13 Nov 2014 22:41:09 +0200 Subject: [PATCH] Inherit input devices using Window::signal_input_event from sigc::trackable --- source/input/hub.h | 3 ++- source/input/keyboard.h | 3 ++- source/input/mouse.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/input/hub.h b/source/input/hub.h index 8d41bce..31eeb94 100644 --- a/source/input/hub.h +++ b/source/input/hub.h @@ -2,6 +2,7 @@ #define MSP_INPUT_INPUTHUB_H_ #include +#include #include "device.h" namespace Msp { @@ -11,7 +12,7 @@ namespace Input { The Hub device collects events from multiple input devices and presents an aggregate of them. Button and axis numbers are mapped to unique values. */ -class Hub: public Device +class Hub: public Device, public sigc::trackable { protected: std::map devices; diff --git a/source/input/keyboard.h b/source/input/keyboard.h index 8cd83f2..15fe4f9 100644 --- a/source/input/keyboard.h +++ b/source/input/keyboard.h @@ -1,6 +1,7 @@ #ifndef MSP_INPUT_KEYBOARD_H_ #define MSP_INPUT_KEYBOARD_H_ +#include #include #include #include "device.h" @@ -12,7 +13,7 @@ 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; diff --git a/source/input/mouse.h b/source/input/mouse.h index c85d8d2..622a783 100644 --- a/source/input/mouse.h +++ b/source/input/mouse.h @@ -1,6 +1,7 @@ #ifndef MSP_INPUT_MOUSE_H_ #define MSP_INPUT_MOUSE_H_ +#include #include #include "device.h" @@ -13,7 +14,7 @@ uniform way. Note: Y axis grows upwards. */ -class Mouse: public Device +class Mouse: public Device, public sigc::trackable { private: Graphics::Window &window; -- 2.45.2