Skip to content

Commit f3401af

Browse files
authored
Fixed an issue where navigation shortcuts wouldn't work when items were selected (#2147)
1 parent 381dd0b commit f3401af

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

Files/UserControls/ModernNavigationToolbar.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@
678678
<Button.KeyboardAccelerators>
679679
<KeyboardAccelerator Key="XButton1" />
680680
<KeyboardAccelerator Key="Back" />
681+
<KeyboardAccelerator Key="Left" Modifiers="Menu" />
681682
</Button.KeyboardAccelerators>
682683
</Button>
683684

@@ -703,6 +704,7 @@
703704
</Button.Content>
704705
<Button.KeyboardAccelerators>
705706
<KeyboardAccelerator Key="XButton2" />
707+
<KeyboardAccelerator Key="Right" Modifiers="Menu" />
706708
</Button.KeyboardAccelerators>
707709
</Button>
708710

Files/Views/LayoutModes/GenericFileBrowser.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ private void AllView_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
434434
{
435435
AssociatedInteractions.ShowPropertiesButton_Click(null, null);
436436
}
437+
else if (e.KeyStatus.IsMenuKeyDown && (e.Key == VirtualKey.Left || e.Key == VirtualKey.Right || e.Key == VirtualKey.Up))
438+
{
439+
// Unfocus the GridView so keyboard shortcut can be handled
440+
this.Focus(FocusState.Programmatic);
441+
}
437442
}
438443

439444
public void AllView_RightTapped(object sender, RightTappedRoutedEventArgs e)

Files/Views/LayoutModes/GridViewBrowser.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ private void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
307307
e.Handled = true;
308308
}
309309
}
310+
else if (e.KeyStatus.IsMenuKeyDown && (e.Key == VirtualKey.Left || e.Key == VirtualKey.Right || e.Key == VirtualKey.Up))
311+
{
312+
// Unfocus the GridView so keyboard shortcut can be handled
313+
this.Focus(FocusState.Programmatic);
314+
}
310315
}
311316

312317
protected override void Page_CharacterReceived(CoreWindow sender, CharacterReceivedEventArgs args)

Files/Views/ModernShellPage.xaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,6 @@
121121
Key="Space"
122122
Invoked="KeyboardAccelerator_Invoked"
123123
Modifiers="None" />
124-
<KeyboardAccelerator
125-
Key="Left"
126-
Invoked="KeyboardAccelerator_Invoked"
127-
Modifiers="Menu" />
128-
<KeyboardAccelerator
129-
Key="Right"
130-
Invoked="KeyboardAccelerator_Invoked"
131-
Modifiers="Menu" />
132124
<KeyboardAccelerator
133125
Key="R"
134126
Invoked="KeyboardAccelerator_Invoked"

Files/Views/ModernShellPage.xaml.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,6 @@ private async void KeyboardAccelerator_Invoked(KeyboardAccelerator sender, Keybo
290290
}
291291
break;
292292

293-
case (false, false, true, true, VirtualKey.Left): // alt + back arrow, backward
294-
NavigationActions.Back_Click(null, null);
295-
break;
296-
297-
case (false, false, true, true, VirtualKey.Right): // alt + right arrow, forward
298-
NavigationActions.Forward_Click(null, null);
299-
break;
300-
301293
case (true, false, false, true, VirtualKey.R): // ctrl + r, refresh
302294
NavigationActions.Refresh_Click(null, null);
303295
break;

0 commit comments

Comments
 (0)