From 8dbddc01acb154403c38348fd3fbea22ee0b33c4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 8 Jul 2008 15:22:39 +0000 Subject: [PATCH] Make events work with Console Derive EventDispatcher from sigc::trackable --- source/console.cpp | 3 +++ source/eventdispatcher.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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(); -- 2.43.0