private:
virtual void tick();
+ void got_focus();
+ void lost_focus();
void key_press(unsigned);
void key_release(unsigned);
void character(StringCodec::unichar);
keyboard(window),
mouse(window)
{
+ window.get_display().signal_got_focus.connect(sigc::mem_fun(this, &Ev::got_focus));
+ window.get_display().signal_lost_focus.connect(sigc::mem_fun(this, &Ev::lost_focus));
window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Ev::exit), 0));
keyboard.signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Ev::key_press), false));
keyboard.signal_button_release.connect(sigc::bind_return(sigc::mem_fun(this, &Ev::key_release), false));
Time::sleep(Time::msec);
}
+void Ev::got_focus()
+{
+ IO::print("got_focus\n");
+}
+
+void Ev::lost_focus()
+{
+ IO::print("lost_focus\n");
+}
+
void Ev::key_press(unsigned key)
{
IO::print("key_press: %s\n", keyboard.get_button_name(key));