From 3aac2013b5e3a5ec83debadb088488413814be83 Mon Sep 17 00:00:00 2001 From: mat1jaczyyy Date: Fri, 16 Aug 2019 04:30:52 +0200 Subject: [PATCH] Check for InputModifiers.None in KeyDown events --- Apollo/Helpers/SelectionManager.cs | 5 +++-- Apollo/Windows/PatternWindow.cs | 5 ++++- Apollo/Windows/ProjectWindow.cs | 2 ++ Apollo/Windows/TrackWindow.cs | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Apollo/Helpers/SelectionManager.cs b/Apollo/Helpers/SelectionManager.cs index f9f60ebb..e9ffeb4b 100644 --- a/Apollo/Helpers/SelectionManager.cs +++ b/Apollo/Helpers/SelectionManager.cs @@ -139,12 +139,13 @@ public bool HandleKey(KeyEventArgs e) { else if (e.Key == Key.A) SelectAll(); else return false; - } else { + } else if (e.Modifiers == InputModifiers.None) { if (e.Key == Key.Delete || e.Key == Key.Back) Action("Delete"); else if (e.Key == Key.D0 || e.Key == Key.NumPad0) Action("Mute"); else if (e.Key == Key.F2) Action("Rename"); else return false; - } + + } else return false; return true; } diff --git a/Apollo/Windows/PatternWindow.cs b/Apollo/Windows/PatternWindow.cs index 0ca853d0..3cfabf11 100644 --- a/Apollo/Windows/PatternWindow.cs +++ b/Apollo/Windows/PatternWindow.cs @@ -448,7 +448,8 @@ void Frame_AfterClick(object sender, PointerReleasedEventArgs e) { async void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter || e.Key == Key.Space) { if (e.Modifiers == InputModifiers.Shift) PatternFire(Fire, null); - else PatternPlay(Play, null); + else if (e.Modifiers == InputModifiers.None) PatternPlay(Play, null); + return; } if (Locked) return; @@ -462,6 +463,8 @@ async void Window_KeyDown(object sender, KeyEventArgs e) { return; } + if (e.Modifiers != InputModifiers.None && e.Modifiers != InputModifiers.Shift) return; + bool shift = e.Modifiers == InputModifiers.Shift; if (e.Key == Key.Up || e.Key == Key.Left) { diff --git a/Apollo/Windows/ProjectWindow.cs b/Apollo/Windows/ProjectWindow.cs index 1c729761..fa17d14f 100644 --- a/Apollo/Windows/ProjectWindow.cs +++ b/Apollo/Windows/ProjectWindow.cs @@ -215,6 +215,8 @@ async void Window_KeyDown(object sender, KeyEventArgs e) { if (Program.WindowKey(this, e) || await Program.Project.HandleKey(this, e) || Program.Project.Undo.HandleKey(e) || Selection.HandleKey(e)) return; + if (e.Modifiers != InputModifiers.None && e.Modifiers != InputModifiers.Shift) 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) diff --git a/Apollo/Windows/TrackWindow.cs b/Apollo/Windows/TrackWindow.cs index 22330ad1..1969bdc5 100644 --- a/Apollo/Windows/TrackWindow.cs +++ b/Apollo/Windows/TrackWindow.cs @@ -139,6 +139,8 @@ async void Window_KeyDown(object sender, KeyEventArgs e) { if (Program.WindowKey(this, e) || await Program.Project.HandleKey(this, e) || Program.Project.Undo.HandleKey(e) || Selection.HandleKey(e)) return; + if (e.Modifiers != InputModifiers.None && e.Modifiers != InputModifiers.Shift) return; + bool vertical = Selection.Start.GetType() == typeof(Chain); if (vertical) {