Ejemplo n.º 1
0
        private void ProcessKeyboardEvents(Event currentEvent)
        {
            switch (currentEvent.keyCode)
            {
            case KeyCode.Delete:
                if (currentEvent.type == EventType.KeyDown)
                {
                    if (!EditorGUIUtility.editingTextField)
                    {
                        _canvas.Graph.Editor().DeleteSelection();
                    }
                }
                break;

            case KeyCode.D:
                if (currentEvent.control)
                {
                    _canvas.Graph.Editor().DuplicateSelection();
                }
                break;

            case KeyCode.G:
                if (currentEvent.type == EventType.KeyDown)
                {
                    if (currentEvent.control)
                    {
                        _canvas.Graph.Editor().GroupSelection();
                    }
                }
                break;

            case KeyCode.M:
                if (currentEvent.type == EventType.KeyDown)
                {
                    if (currentEvent.control)
                    {
                        ColapseToFollowMachine.Instance.Collapse(_canvas.Graph);
                    }
                }
                break;

            case KeyCode.L:
                if (currentEvent.type == EventType.KeyDown)
                {
                    if (currentEvent.control)
                    {
                        LayoutGraph.ReLayout(_canvas.Graph);
                    }
                }
                break;

            case KeyCode.F:
                if (currentEvent.type == EventType.KeyDown)
                {
                    if (_canvas.Graph.Editor().SelectedNode == null)
                    {
                        _canvas.CordinationSystem.Focus(false, true);
                    }
                    else
                    {
                        _canvas.CordinationSystem.Focus(true, true);
                    }
                }
                break;
            }
        }