void OnTreeViewKeyPressed (object sender, Gtk.KeyPressEventArgs args)
{
switch (args.Event.Key) {
case Gdk.Key.Menu:
// Pop up the context menu if a note is selected
List<Note> selected_notes = GetSelectedNotes ();
if (selected_notes != null && selected_notes.Count > 0) {
Gtk.Menu menu = Tomboy.ActionManager.GetWidget (
"/MainWindowContextMenu") as Gtk.Menu;
PopupContextMenuAtLocation (menu, 0, 0);
args.RetVal = true;
}
break;
case Gdk.Key.Return:
case Gdk.Key.KP_Enter:
// Open all selected notes
OnOpenNote (this, args);
args.RetVal = true;
break;
}
}