private void HandleKey(object sender, KeyEventArgs args) { switch (args.KeyCode) { case Keys.Left: mapCtrl.SelectNodeLeftOrUnfold(); break; case Keys.Right: mapCtrl.SelectNodeRightOrUnfold(); break; case Keys.Up: mapCtrl.SelectNodeAbove(); break; case Keys.Down: mapCtrl.SelectNodeBelow(); break; case Keys.Space: mapCtrl.ToggleFolded(); break; case Keys.Enter: mapCtrl.AppendNodeAndEdit(); break; case Keys.PageUp: mapCtrl.SelectTopSibling(); break; case Keys.PageDown: mapCtrl.SelectBottomSibling(); break; case Keys.End: mapCtrl.BeginCurrentNodeEdit(TextCursorPosition.End); break; case Keys.Home: mapCtrl.BeginCurrentNodeEdit(TextCursorPosition.Start); break; case Keys.Insert: case Keys.Tab: mapCtrl.AppendChildNodeAndEdit(); break; case Keys.Delete: mapCtrl.DeleteSelectedNodes(); break; case Keys.F2: mapCtrl.BeginCurrentNodeEdit(TextCursorPosition.Undefined); break; } }