Beispiel #1
0
        async void HandleKey(object sender, KeyEventArgs e)
        {
            if (App.Dragging)
            {
                return;
            }

            if (App.WindowKey(this, e) || await Program.Project.HandleKey(this, e) || Program.Project.Undo.HandleKey(e) || Selection.HandleKey(e))
            {
                return;
            }

            if (e.KeyModifiers != KeyModifiers.None && e.KeyModifiers != KeyModifiers.Shift)
            {
                return;
            }

            if (e.Key == Key.Up)
            {
                Selection.Move(false, e.KeyModifiers == KeyModifiers.Shift);
            }
            else if (e.Key == Key.Down)
            {
                Selection.Move(true, e.KeyModifiers == KeyModifiers.Shift);
            }

            else if (e.Key == Key.Enter)
            {
                foreach (ISelect i in Selection.Selection)
                {
                    TrackWindow.Create((Track)i, this);
                }
            }
        }
Beispiel #2
0
        private async void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (await Program.Project.HandleKey(this, e) || Program.Project.Undo.HandleKey(e) || Selection.HandleKey(e))
            {
                return;
            }

            if (e.Key == Key.Up)
            {
                Selection.Move(false, e.Modifiers == InputModifiers.Shift);
            }
            else if (e.Key == Key.Down)
            {
                Selection.Move(true, e.Modifiers == InputModifiers.Shift);
            }
            else if (e.Key == Key.Enter)
            {
                foreach (ISelect i in Selection.Selection)
                {
                    TrackWindow.Create((Track)i, this);
                }
            }
        }