File tree 3 files changed +18
-1
lines changed 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 35
35
<NativeMenu .Menu>
36
36
<NativeMenu >
37
37
<NativeMenuItem Header =" {DynamicResource Text.About.Menu}" Command =" {x:Static s:App.OpenAboutCommand}" />
38
- <NativeMenuItem Header =" {DynamicResource Text.Hotkeys}" Command =" {x:Static s:App.OpenHotkeysCommand}" />
38
+ <NativeMenuItem Header =" {DynamicResource Text.Hotkeys}" Command =" {x:Static s:App.OpenHotkeysCommand}" Gesture = " F1 " />
39
39
<NativeMenuItem Header =" {DynamicResource Text.SelfUpdate}" Command =" {x:Static s:App.CheckForUpdateCommand}" IsVisible =" {x:Static s:App.IsCheckForUpdateCommandVisible}" />
40
40
<NativeMenuItemSeparator />
41
41
<NativeMenuItem Header =" {DynamicResource Text.Preferences}" Command =" {x:Static s:App.OpenPreferencesCommand}" Gesture =" ⌘+," />
Original file line number Diff line number Diff line change
1
+ using Avalonia . Input ;
2
+
1
3
namespace SourceGit . Views
2
4
{
3
5
public partial class Hotkeys : ChromelessWindow
@@ -6,5 +8,13 @@ public Hotkeys()
6
8
{
7
9
InitializeComponent ( ) ;
8
10
}
11
+
12
+ protected override void OnKeyDown ( KeyEventArgs e )
13
+ {
14
+ base . OnKeyDown ( e ) ;
15
+
16
+ if ( ! e . Handled && e . Key == Key . Escape )
17
+ Close ( ) ;
18
+ }
9
19
}
10
20
}
Original file line number Diff line number Diff line change @@ -141,6 +141,13 @@ protected override void OnKeyDown(KeyEventArgs e)
141
141
return ;
142
142
}
143
143
144
+ // F1 opens preference dialog (macOS use hotkeys in system menu bar)
145
+ if ( ! OperatingSystem . IsMacOS ( ) && e . Key == Key . F1 )
146
+ {
147
+ App . ShowWindow ( new Hotkeys ( ) , true ) ;
148
+ return ;
149
+ }
150
+
144
151
// Ctrl+Q quits the application (macOS use hotkeys in system menu bar)
145
152
if ( ! OperatingSystem . IsMacOS ( ) && e . KeyModifiers == KeyModifiers . Control && e . Key == Key . Q )
146
153
{
You can’t perform that action at this time.
0 commit comments