Skip to content

Commit

Permalink
Added ability to copy capitalized native name
Browse files Browse the repository at this point in the history
  • Loading branch information
zziger committed Jun 20, 2022
1 parent 1e647a7 commit 426f6d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/.idea.AltV.PowerToysRun.Natives/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.PowerToys.Settings.UI.Library;
using Wox.Plugin;

namespace AltV.PowerToysRun.Natives;
Expand Down Expand Up @@ -175,6 +177,19 @@ public List<ContextMenuResult> LoadContextMenus(Result selectedResult)
FontFamily = "Segoe MDL2 Assets",
AcceleratorKey = Key.Return,
AcceleratorModifiers = ModifierKeys.Shift
},
new()
{
Title = "Copy capitalized name (Ctrl + Shift + Enter)",
Action = _ =>
{
Clipboard.SetText(e.native.AltName[0].ToString().ToUpperInvariant() + e.native.AltName[1..]);
return false;
},
Glyph = "\uE8C8",
FontFamily = "Segoe MDL2 Assets",
AcceleratorKey = Key.Return,
AcceleratorModifiers = ModifierKeys.Shift | ModifierKeys.Control,
}
};
}
Expand Down

0 comments on commit 426f6d5

Please sign in to comment.