diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWPApplication.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWPApplication.cs index 64ba6f350d..1cf4bc4463 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWPApplication.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWPApplication.cs @@ -12,6 +12,7 @@ using Microsoft.CmdPal.Ext.Apps.Commands; using Microsoft.CmdPal.Ext.Apps.Properties; using Microsoft.CmdPal.Ext.Apps.Utils; using Microsoft.CommandPalette.Extensions.Toolkit; +using Windows.System; using Windows.Win32; using Windows.Win32.Storage.Packaging.Appx; using PackageVersion = Microsoft.CmdPal.Ext.Apps.Programs.UWP.PackageVersion; @@ -77,14 +78,20 @@ public class UWPApplication : IProgram { commands.Add( new CommandContextItem( - new RunAsAdminCommand(UniqueIdentifier, string.Empty, true))); + new RunAsAdminCommand(UniqueIdentifier, string.Empty, true)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.Enter), + }); // We don't add context menu to 'run as different user', because UWP applications normally installed per user and not for all users. } commands.Add( new CommandContextItem( - new CopyPathCommand(Location))); + new CopyPathCommand(Location)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.C), + }); commands.Add( new CommandContextItem( @@ -92,11 +99,17 @@ public class UWPApplication : IProgram { Name = Resources.open_containing_folder, Icon = new("\ue838"), - })); + }) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.E), + }); commands.Add( new CommandContextItem( - new OpenInConsoleCommand(Package.Location))); + new OpenInConsoleCommand(Package.Location)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.R), + }); return commands; } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/Win32Program.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/Win32Program.cs index 7bc13f8122..dd6bdd875d 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/Win32Program.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/Win32Program.cs @@ -22,6 +22,7 @@ using Microsoft.CmdPal.Ext.Apps.Properties; using Microsoft.CmdPal.Ext.Apps.Utils; using Microsoft.CommandPalette.Extensions.Toolkit; using Microsoft.Win32; +using Windows.System; namespace Microsoft.CmdPal.Ext.Apps.Programs; @@ -192,20 +193,35 @@ public class Win32Program : IProgram if (AppType != ApplicationType.InternetShortcutApplication && AppType != ApplicationType.Folder && AppType != ApplicationType.GenericFile) { commands.Add(new CommandContextItem( - new RunAsAdminCommand(!string.IsNullOrEmpty(LnkFilePath) ? LnkFilePath : FullPath, ParentDirectory, false))); + new RunAsAdminCommand(!string.IsNullOrEmpty(LnkFilePath) ? LnkFilePath : FullPath, ParentDirectory, false)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.Enter), + }); commands.Add(new CommandContextItem( - new RunAsUserCommand(!string.IsNullOrEmpty(LnkFilePath) ? LnkFilePath : FullPath, ParentDirectory))); + new RunAsUserCommand(!string.IsNullOrEmpty(LnkFilePath) ? LnkFilePath : FullPath, ParentDirectory)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.U), + }); } commands.Add(new CommandContextItem( - new CopyPathCommand(FullPath))); + new CopyPathCommand(FullPath)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.C), + }); commands.Add(new CommandContextItem( - new OpenPathCommand(ParentDirectory))); + new OpenPathCommand(ParentDirectory)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.E), + }); commands.Add(new CommandContextItem( - new OpenInConsoleCommand(ParentDirectory))); + new OpenInConsoleCommand(ParentDirectory)) + { + RequestedShortcut = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.R), + }); return commands; }