Skip to content

Commit

Permalink
Fix touch shortcut ESC
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Aug 25, 2022
1 parent afe52f8 commit 1348d0b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions HandheldCompanion/Views/Windows/QuickTools.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ private void navView_ItemInvoked(NavigationView sender, NavigationViewItemInvoke
NavigationViewItem navItem = (NavigationViewItem)args.InvokedItemContainer;
string navItemTag = (string)navItem.Tag;

var foregroundProcess = MainWindow.processManager.GetForegroundProcess();

switch (navItemTag)
{
default:
Expand All @@ -139,14 +141,16 @@ private void navView_ItemInvoked(NavigationView sender, NavigationViewItemInvoke
MainWindow.inputsManager.KeyPress(new VirtualKeyCode[] { VirtualKeyCode.LWIN, VirtualKeyCode.VK_D });
break;
case "shortcutESC":
MainWindow.inputsManager.KeyPress(VirtualKeyCode.ESCAPE);
if (foregroundProcess != null)
{
SetForegroundWindow(foregroundProcess.MainWindowHandle);
MainWindow.inputsManager.KeyPress(VirtualKeyCode.ESCAPE);
}
break;
case "shortcutExpand":
var foregroundProcess = MainWindow.processManager.GetForegroundProcess();
if (foregroundProcess != null)
{
SetForegroundWindow(foregroundProcess.MainWindowHandle);
ShowWindow(foregroundProcess.MainWindowHandle, SW_SHOWMAXIMIZED);
MainWindow.inputsManager.KeyStroke(VirtualKeyCode.LMENU, VirtualKeyCode.RETURN);
}
break;
Expand Down

0 comments on commit 1348d0b

Please sign in to comment.