enhance: use instead of Ctrl , instead of Alt for all hotkeys used by this app on macOS (#103)

This commit is contained in:
leo 2024-05-05 18:19:59 +08:00
parent 9627206764
commit 68566b9b34
5 changed files with 26 additions and 19 deletions

View file

@ -98,7 +98,8 @@ namespace SourceGit.Views
protected override void OnKeyDown(KeyEventArgs e)
{
var vm = DataContext as ViewModels.Launcher;
if (e.KeyModifiers.HasFlag(KeyModifiers.Control))
if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) ||
(!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control)))
{
if (e.Key == Key.W)
{
@ -106,7 +107,14 @@ namespace SourceGit.Views
e.Handled = true;
return;
}
else if (e.Key == Key.Tab)
else if (e.Key == Key.T)
{
vm.AddNewTab();
e.Handled = true;
return;
}
else if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) ||
(!OperatingSystem.IsMacOS() && e.Key == Key.Tab))
{
vm.GotoNextTab();
e.Handled = true;