private void Window_KeyDown(object sender, KeyEventArgs e) { //Debug.WriteLine("Window_KeyDown"); if (e.Key == Key.Delete) { if (theNeuronArrayView.theSelection.selectedRectangles.Count > 0) { theNeuronArrayView.DeleteSelection(); theNeuronArrayView.ClearSelection(); theNeuronArrayView.Update(); } else { if (theNeuronArray != null) { theNeuronArray.UndoSynapse(); theNeuronArrayView.Update(); } } } if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) { ctrlPressed = true; } if (e.Key == Key.LeftShift || e.Key == Key.RightShift) { shiftPressed = true; theNeuronArrayView.theCanvas.Cursor = Cursors.Hand; } if (e.Key == Key.Escape) { if (theNeuronArrayView.theSelection.selectedRectangles.Count > 0) { theNeuronArrayView.ClearSelection(); Update(); } } if (ctrlPressed && e.Key == Key.C) { theNeuronArrayView.CopyNeurons(); } if (ctrlPressed && e.Key == Key.V) { theNeuronArrayView.PasteNeurons(); } if (ctrlPressed && e.Key == Key.X) { theNeuronArrayView.CutNeurons(); } if (ctrlPressed && e.Key == Key.Z) { if (theNeuronArray != null) { theNeuronArray.UndoSynapse(); theNeuronArrayView.Update(); } } }