aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Controls/TerminalBox.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/Controls/TerminalBox.cs b/ShiftOS.WinForms/Controls/TerminalBox.cs
index 4fcb429..b75d077 100644
--- a/ShiftOS.WinForms/Controls/TerminalBox.cs
+++ b/ShiftOS.WinForms/Controls/TerminalBox.cs
@@ -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);
+ }
}
}