mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[Peek]Hide window with esc key (#26250)
This commit is contained in:
committed by
GitHub
parent
6f56b35a6c
commit
4560abe557
@@ -14,11 +14,11 @@
|
|||||||
<winuiex:WindowEx.Backdrop>
|
<winuiex:WindowEx.Backdrop>
|
||||||
<winuiex:MicaSystemBackdrop />
|
<winuiex:MicaSystemBackdrop />
|
||||||
</winuiex:WindowEx.Backdrop>
|
</winuiex:WindowEx.Backdrop>
|
||||||
|
|
||||||
<Grid KeyboardAcceleratorPlacementMode="Hidden">
|
<Grid KeyboardAcceleratorPlacementMode="Hidden">
|
||||||
<Grid.KeyboardAccelerators>
|
<Grid.KeyboardAccelerators>
|
||||||
<KeyboardAccelerator Key="Left" Invoked="LeftNavigationInvoked" />
|
<KeyboardAccelerator Key="Left" Invoked="LeftNavigationInvoked" />
|
||||||
<KeyboardAccelerator Key="Right" Invoked="RightNavigationInvoked" />
|
<KeyboardAccelerator Key="Right" Invoked="RightNavigationInvoked" />
|
||||||
|
<KeyboardAccelerator Key="Escape" Invoked="EscKeyInvoked" />
|
||||||
</Grid.KeyboardAccelerators>
|
</Grid.KeyboardAccelerators>
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|||||||
@@ -69,6 +69,11 @@ namespace Peek.UI
|
|||||||
ViewModel.AttemptRightNavigation();
|
ViewModel.AttemptRightNavigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EscKeyInvoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args)
|
||||||
|
{
|
||||||
|
Uninitialize();
|
||||||
|
}
|
||||||
|
|
||||||
private void Initialize()
|
private void Initialize()
|
||||||
{
|
{
|
||||||
var bootTime = new System.Diagnostics.Stopwatch();
|
var bootTime = new System.Diagnostics.Stopwatch();
|
||||||
|
|||||||
Reference in New Issue
Block a user