[CmdPal] Windows Services restart kb shortcuts (#38150)

* [CmdPal] Windows Services open/restart kb shortcuts

* Given both restart and stop has its shortcut, only do for open with the shortcut "ctr+o"
This commit is contained in:
Stefan Markovic
2025-03-26 08:55:40 +01:00
committed by GitHub
parent 2cb63f5fbe
commit 39e8231831
2 changed files with 7 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ using Microsoft.CmdPal.Ext.WindowsServices.Properties;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using Microsoft.Win32;
using Windows.System;
namespace Microsoft.CmdPal.Ext.WindowsServices.Helpers;
@@ -53,7 +54,10 @@ public static class ServiceHelper
serviceCommand = new ServiceCommand(serviceResult, Action.Stop);
moreCommands = [
new CommandContextItem(new RestartServiceCommand(serviceResult)),
new CommandContextItem(new OpenServicesCommand(serviceResult)),
new CommandContextItem(new OpenServicesCommand(serviceResult))
{
RequestedShortcut = KeyChordHelpers.FromModifiers(true, false, false, false, (int)VirtualKey.O, 0),
},
];
}
else