void OnKeyPressed (object sender, Gtk.KeyPressEventArgs args) { switch (args.Event.Key) { case Gdk.Key.Escape: // Allow Escape to close the window OnCloseWindow (this, EventArgs.Empty); break; } }