mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
selecting content in terminal copies to clipboard
This commit is contained in:
parent
e51f51b7d1
commit
5f0cfb100c
1 changed files with 24 additions and 0 deletions
|
@ -61,5 +61,29 @@ namespace ShiftOS.WinForms.Controls
|
|||
{
|
||||
this.AppendText(Localization.Parse(text) + Environment.NewLine);
|
||||
}
|
||||
|
||||
bool quickCopying = false;
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
//if right-clicking, then we initiate a quick-copy.
|
||||
if (e.Button == MouseButtons.Right)
|
||||
quickCopying = true;
|
||||
|
||||
//Override the mouse event so that it's a left-click at all times.
|
||||
base.OnMouseDown(new MouseEventArgs(MouseButtons.Left, e.Clicks, e.X, e.Y, e.Delta));
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs mevent)
|
||||
{
|
||||
if(quickCopying == true)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(this.SelectedText))
|
||||
{
|
||||
this.Copy();
|
||||
}
|
||||
}
|
||||
base.OnMouseUp(mevent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue