Skip to content

Commit 27f4767

Browse files
double Escape will quit the app
1 parent 1c1973f commit 27f4767

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

UnityHubNative.Net/MainWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MainWindow : Window
2727

2828
static DockPanel s_transparentPanel;
2929
static Slider s_backgroundBlurIntensitySlider;
30+
static private Key s_lastKey;
3031

3132
public MainWindow(object data)
3233
{
@@ -49,6 +50,10 @@ public MainWindow(object data)
4950
protected override void OnKeyDown(KeyEventArgs e)
5051
{
5152
base.OnKeyDown(e);
53+
if (e.Key == Key.Escape && s_lastKey == Key.Escape)
54+
Close();
55+
56+
s_lastKey = e.Key;
5257

5358
// focus on searchbar if typed a character
5459
if (e.KeyModifiers is KeyModifiers.None or KeyModifiers.Shift && (int)e.Key >= (int)Key.A && (int)e.Key <= (int)Key.Z)

0 commit comments

Comments
 (0)