diff options
| author | AShifter <[email protected]> | 2017-03-11 09:22:10 -0700 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-03-11 09:22:10 -0700 |
| commit | d15965e442a1d29424f2e6f315dae3281154f944 (patch) | |
| tree | 26002bfe906c3ba2f881e365ca94c712950f395d /ShiftOS.WinForms/Controls | |
| parent | bb768396787bd0ea5e608f007d881edec693f2ed (diff) | |
| parent | 2ff261328740cbb628678605b09800f22c9b67a9 (diff) | |
| download | shiftos_thereturn-d15965e442a1d29424f2e6f315dae3281154f944.tar.gz shiftos_thereturn-d15965e442a1d29424f2e6f315dae3281154f944.tar.bz2 shiftos_thereturn-d15965e442a1d29424f2e6f315dae3281154f944.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS.WinForms/Controls')
| -rw-r--r-- | ShiftOS.WinForms/Controls/TerminalBox.cs | 24 |
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); + } } } |
