diff --git a/MainWindow.xaml b/MainWindow.xaml index 8f85ca6..ccc8770 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -230,6 +230,7 @@ GridLinesVisibility="None" VirtualizingPanel.ScrollUnit="Pixel" PreviewMouseWheel="SmoothList_PreviewMouseWheel" + PreviewKeyDown="TrackGrid_PreviewKeyDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"> diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 8a69d1c..01fd067 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -403,6 +403,13 @@ public partial class MainWindow : FluentWindow /// Windows has associated with .mkv files (typically the default video /// player), so the user can quickly preview a file without leaving the app. /// + private void TrackGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) + { + if (e.Key != System.Windows.Input.Key.Space) return; + OpenSelectedFileInDefaultPlayer(); + e.Handled = true; + } + private void OpenSelectedFileInDefaultPlayer() { if (FileQueueList.SelectedItem is not QueuedFileItem item) return;