Skip to content

Commit

Permalink
right-click paste in the laziest possible way
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleyewdee committed Dec 19, 2018
1 parent d96e91a commit c02c816
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/condo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
{
Expand Down

0 comments on commit c02c816

Please sign in to comment.