From: Mikko Rasa Date: Tue, 8 Jul 2008 15:22:39 +0000 (+0000) Subject: Make events work with Console X-Git-Tag: io-1.0~4 X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=8dbddc01acb154403c38348fd3fbea22ee0b33c4 Make events work with Console Derive EventDispatcher from sigc::trackable --- diff --git a/source/console.cpp b/source/console.cpp index eb7ac4b..51617d3 100644 --- a/source/console.cpp +++ b/source/console.cpp @@ -44,6 +44,9 @@ Console::Console(unsigned n) if(handle==0) tcgetattr(handle, &orig_attr); #endif + + if(n==0) + set_events(P_INPUT); } Console::~Console() diff --git a/source/eventdispatcher.h b/source/eventdispatcher.h index 9bea6d2..6f6fe6f 100644 --- a/source/eventdispatcher.h +++ b/source/eventdispatcher.h @@ -8,6 +8,7 @@ Distributed under the LGPL #define EVENTDISPATCHER_H_ #include +#include #include "poll.h" namespace Msp { @@ -17,7 +18,7 @@ namespace IO { Put your I/O objects inside one of these to get signaled when something happens on some of them. */ -class EventDispatcher +class EventDispatcher: public sigc::trackable { public: EventDispatcher();