Login  
Search All Forums
Dart Home | PowerTCP Emulation for .NET | Custom Development Reply | PowerTCP Emulation for .NET Topics | Forums   
AuthorForum: PowerTCP Emulation for .NET
Topic: Copy and Paste in a VT terminal?
anthonyb

From: USA
Posts: 2
Member Since: 02/29/16
posted March 1, 2016 2:05 PM

Hello,

I am using a Dart.Emulation.Vt object in my application to allow users to interface with my SSH client code.

Our users noticed that you cannot copy or paste into the VT window. I have tried ctrl+c, alt+c, alt+shift+c... nothing works. Is there a special keystroke that Dart uses for copy/paste?

Thank you! - Anthony
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 1, 2016 2:42 PM

Hello,

There is no built-in shortcut copy/paste functionality (ctrl+c can be used to abort the current task in many command-line interfaces), but it may be implemented at the application-level as desired. I've copied the code used for copy/paste functionality in our included Telnet Client sample below, which can be adapted as needed:

private void copyToolStripMenuItem_Click(object sender, System.EventArgs e)
{
//Copy selected text to Clipboard.
if ((vt1.Selection.End.X < 1) || vt1.Selection.End.Y < 0)
return;
string scrapedText = vt1.ScrapeText(vt1.Selection.Start, vt1.Selection.End, vt1.Selection.Mode);
Clipboard.SetDataObject(scrapedText);
}

private void pasteToolStripMenuItem_Click(object sender, System.EventArgs e)
{
//Place text from Clipboard into VT1.
IDataObject iData = Clipboard.GetDataObject();
if (iData.GetDataPresent(DataFormats.Text))
{
string s = iData.GetData(DataFormats.Text).ToString();
if (s.Length > 0) telnetModel.WriteData(s);
}
}

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

anthonyb

From: USA
Posts: 2
Member Since: 02/29/16
posted March 1, 2016 2:52 PM

Thank you for the FAST response, very much appreciated. I will try implementing this, thank you! - Anthony
Reply | PowerTCP Emulation for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX