File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -553,13 +553,13 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () =>
553553
554554 public void PathBoxItem_PreviewKeyDown ( object sender , KeyRoutedEventArgs e )
555555 {
556- if ( e . Key == Windows . System . VirtualKey . Down )
556+ if ( e . Key is Windows . System . VirtualKey . Down )
557557 {
558558 var item = e . OriginalSource as ListViewItem ;
559559 var button = item ? . FindDescendant < Button > ( ) ;
560560 button ? . Flyout . ShowAt ( button ) ;
561561 e . Handled = true ;
562- } else if ( e . Key == Windows . System . VirtualKey . Space || e . Key == Windows . System . VirtualKey . Enter )
562+ } else if ( e . Key is Windows . System . VirtualKey . Space or Windows . System . VirtualKey . Enter )
563563 {
564564 var item = e . OriginalSource as ListViewItem ;
565565 var path = ( item ? . Content as PathBoxItem ) ? . Path ;
Original file line number Diff line number Diff line change @@ -234,13 +234,20 @@ private async Task OnPreviewKeyDownAsync(KeyRoutedEventArgs e)
234234 default :
235235 var currentModifiers = HotKeyHelpers . GetCurrentKeyModifiers ( ) ;
236236 HotKey hotKey = new ( ( Keys ) e . Key , currentModifiers ) ;
237+ var source = ( DependencyObject ) e . OriginalSource ;
237238
238239 // A textbox takes precedence over certain hotkeys.
239- if ( e . OriginalSource is DependencyObject source && source . FindAscendantOrSelf < TextBox > ( ) is not null )
240+ if ( source . FindAscendantOrSelf < TextBox > ( ) is not null )
240241 break ;
241242
242243 // Execute command for hotkey
243244 var command = Commands [ hotKey ] ;
245+
246+ if ( command . Code is CommandCodes . OpenItem && source . FindAscendantOrSelf < PathBreadcrumb > ( ) is not null )
247+ {
248+ break ;
249+ }
250+
244251 if ( command . Code is not CommandCodes . None && keyReleased )
245252 {
246253 keyReleased = false ;
You can’t perform that action at this time.
0 commit comments