[PT Run] Fix some keyboard issues on plugin (#13490)

* Don't use enter for accelerator keys in results

Enter is already used to select commands in the context menu in the
result entries.

* Don't crash when trying to show a tooltip

* Clear hanging tooltips when keyboard navigating

* Starting/stopping service on Enter
This commit is contained in:
Jaime Bernardo
2021-09-28 15:30:44 +01:00
committed by GitHub
parent 7874b77104
commit c85fa98bcc
4 changed files with 54 additions and 16 deletions

View File

@@ -51,6 +51,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Service
Glyph = "\xE71A",
FontFamily = "Segoe MDL2 Assets",
AcceleratorKey = Key.Enter,
AcceleratorModifiers = ModifierKeys.Control,
Action = _ =>
{
Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Stop, _context.API));
@@ -84,6 +85,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Service
Glyph = "\xEDB5",
FontFamily = "Segoe MDL2 Assets",
AcceleratorKey = Key.Enter,
AcceleratorModifiers = ModifierKeys.Control,
Action = _ =>
{
Task.Run(() => ServiceHelper.ChangeStatus(serviceResult, Action.Start, _context.API));
@@ -114,7 +116,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Service
public List<Result> Query(Query query)
{
var search = query?.Search ?? string.Empty;
return ServiceHelper.Search(search, _icoPath).ToList();
return ServiceHelper.Search(search, _icoPath, _context).ToList();
}
public string GetTranslatedPluginTitle()