From c02c81601f05db0a5c0839c331ba92feb309e44d Mon Sep 17 00:00:00 2001 From: Chip Locke Date: Wed, 19 Dec 2018 03:09:43 -0800 Subject: [PATCH] right-click paste in the laziest possible way --- src/condo/MainWindow.xaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/condo/MainWindow.xaml.cs b/src/condo/MainWindow.xaml.cs index c1e4701..a2fbb10 100644 --- a/src/condo/MainWindow.xaml.cs +++ b/src/condo/MainWindow.xaml.cs @@ -106,6 +106,15 @@ private void OnLoaded(object sender, RoutedEventArgs e) this.KeyDown += this.keyHandler.OnKeyDown; this.KeyDown += (_, args) => this.screen.VerticalOffset = double.MaxValue; // force scroll on keypress. this.TextInput += this.keyHandler.OnTextInput; + // XXX: a very hacky paste! + this.MouseRightButtonDown += (_, args) => + { + var text = Clipboard.GetData(DataFormats.Text) as string; + if (!string.IsNullOrWhiteSpace(text)) + { + this.console.SendText(System.Text.Encoding.UTF8.GetBytes(text)); + } + }; this.console.PropertyChanged += (_, args) => {