Beispiel #1
0
        public virtual void KeyDown(object sender, KeyEventArgs e)
        {
#if !PLAYER
            if (e.Key == System.Windows.Input.Key.Escape)
            {
                AbortAndSetDefaultTool();
                e.Handled = true;
            }

            else if (e.Key == System.Windows.Input.Key.Delete)
            {
                try
                {
                    Drawing.DeleteSelection();
                }
                catch (Exception)
                {
                }
            }
            else if (e.Key == System.Windows.Input.Key.A)
            {
                Settings.Instance.AutoLabelPoints = !Settings.Instance.AutoLabelPoints;
                string state = (Settings.Instance.AutoLabelPoints) ? "on." : "off.";
                Drawing.RaiseStatusNotification("Toggling automatic labeling of points " + state);
            }
            else if (e.Key == System.Windows.Input.Key.G)
            {
                Settings.Instance.EnableSnapToGrid = !Settings.Instance.EnableSnapToGrid;
                string state = (Settings.Instance.EnableSnapToGrid) ? "on." : "off.";
                Drawing.RaiseStatusNotification("Toggling constraining to grid " + state);
            }
#endif
        }
Beispiel #2
0
        public override void KeyDown(object sender, KeyEventArgs e)
        {
            var selectedFigures = Drawing.GetSelectedFigures();

            if (e.Key == Key.Delete && !selectedFigures.IsEmpty())
            {
                Drawing.DeleteSelection();
                e.Handled = true;
            }
        }