+ window.signal_key_press.connect(sigc::mem_fun(this, &Root::key_press));
+ window.signal_key_release.connect(sigc::mem_fun(this, &Root::key_release));
+}
+
+void Root::button_press_event(int x, int y, unsigned btn, unsigned)
+{
+ translate_coords(x, y);
+ button_press(x, y, btn);
+}
+
+void Root::button_release_event(int x, int y, unsigned btn, unsigned)
+{
+ translate_coords(x, y);
+ button_release(x, y, btn);
+}
+
+void Root::pointer_motion_event(int x, int y)
+{
+ translate_coords(x, y);
+ pointer_motion(x, y);
+}
+
+void Root::translate_coords(int &x, int &y)
+{
+ x=x*geom.w/window.get_width();
+ y=geom.h-1-y*geom.h/window.get_height();