diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml
index dd8979650..d04b4a165 100644
--- a/Flow.Launcher/MainWindow.xaml
+++ b/Flow.Launcher/MainWindow.xaml
@@ -46,6 +46,10 @@
Key="Tab"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Shift" />
+
SelectedResults.SelectFirstResult());
+ CopyToClipboard = new RelayCommand(index =>
+ {
+ var results = SelectedResults;
+
+ if (index != null)
+ {
+ results.SelectedIndex = int.Parse(index.ToString());
+ }
+
+ var result = results.SelectedItem?.Result;
+ if (result != null) // SelectedItem returns null if selection is empty.
+ {
+ bool hideWindow = result.Action != null && result.Action(new ActionContext
+ {
+ SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
+ });
+ Clipboard.SetText(result.Title.ToString());
+ if (hideWindow)
+ {
+ Hide();
+ }
+
+
+ }
+ });
+
StartHelpCommand = new RelayCommand(_ =>
{
SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
@@ -383,6 +409,7 @@ namespace Flow.Launcher.ViewModel
public ICommand OpenSettingCommand { get; set; }
public ICommand ReloadPluginDataCommand { get; set; }
public ICommand ClearQueryCommand { get; private set; }
+ public ICommand CopyToClipboard { get; set; }
public string OpenResultCommandModifiers { get; private set; }